Normal Mapped Beveled edges look weird in Unity. How do I get this right?

Hello, I am having trouble getting beveled edges in a normal map.

In Blender, if I set my low poly cube to flat shaded, and bake from the high poly, I get this result in Blender

It looks the same in Unity.

If I set my low poly cube to smooth shading before baking, you see my normal map is much more colorful, because it is compensating for my cube being set to smooth shaded. However, in Blender my cube looks perfect!

the edge looks not as good in Unity, but not too bad.

I would ask how to fix that seam in Unity, but that isn’t the bad part. The bad part is when I see the whole cube. It looks shaded really weird.

I want it to be shaded like a normal flat shaded cube, but with beveled edges. It seems that Blender and Unity are doing something different, so they aren’t 1 to 1 on how to display normal maps.

Here are both cubes back to back. The one on the left has good bevels, but the rest of the cube is shaded weird. The cube on the right is shaded good, but the bevels have those weird artifacts. What is the best way to fix this? I am using cubes for now, because I want to figure this out before I do this with more complex models.

Have you tried using your first method, but separating out the UV islands a bit and giving the Normal Bake a margin?

I did try separating the UV islands, and I get the same result. I do think I found a solution though. With a 6 sided cube, the computer struggles to interpolate smoothing over the whole thing because the angles are so sharp, with so few faces. I figure, in a real case scenario I would never have such a huge flat surface that is all 1 polygon without any supporting loops. So I tried putting a few edge loops around the cube to ease the shading a bit. The results are pretty good. Its not perfect, as you can see a tiny bit of shading errors in the corners, but its not very noticeable (could even pass as a dirty spot on the texture)


the closer I bring in the edge loop the smaller the shading error becomes.

Here is a more complex object. I think it works good enough as there aren’t as many huge open polygons by themselves trying to be shaded. The shading gets a little weird at the outer edges of the cylindrical parts, but its not too bad. I’m sure more polygons to fill the silhouette would fix that.


Hi,
I would mark hard edges(normally 90+ deg edges) and use edge split modifier and use cage when baking. Make sure to apply edge split modifier when exporting to unity. As far as I know unity uses the x+ y+ z+ coordinates while blender uses the x+ y- z+. So I think you have to invert the y channel.

Best Regards,
Srinath

What do you mean by “use cage”? Every time I have my edges flat shaded. (even as separate pieces both on the mesh as well as separate UV islands, my baking result is the same as the one in my first post with the messed up corner.

someone in the Unity Forums told me to have separate Smoothing groups for each face, as well as separate UV islands, and posted this picture


In Blender at least, I keep getting the same messed up result. I can’t get it to look like the 2nd cube.

http://www.polycount.com/forum/showthread.php?t=107196
https://www.youtube.com/watch?v=jOMnNb82DRI

Try attached normal maps in unity

Attachments

tttest.zip (157 KB)

Thank you Sawsrinath! I didn’t know there was a difference between having it set to Cycles, vs Blender Render when baking normal maps. That alone makes a huge difference! Normal map 1 works good in Unity, and I was able to recreate that using cycles baking and Cage.

I read the polycount thread you linked, and I’m a little insure on what is meant by "Averaged projection mesh” vs“Explicit mesh normals” Which one does Blender do?

Also, the thread talks about “When using a synced normals workflow. Meaning that your normal map baker and game engine are synced up to provide accurate, reliable display of normal maps between the two,” am I correct in assuming that Blender and Unity are NOT synced, thus why my smoothed cube in my 2nd example looked good in Blender, but bad in Unity?

Thanks again!