Hard Edges, UV Unwrapping and alternative workflows.

Hello, 

So now I know that hard edges have to be marked as sharp otherwise I get artifacts when baking. However, this poses a problem for me because hard surface modeling often has quite a few hard edges. How am I going to make sure that when I unwrap it won't make a complete nightmarish mess? This sounds like a nightmare to be honest. I mentioned in a previous thread that cant I just separate the islands and then leave them as if they had not been moved but this causes problems because they need to have padding. Isn't it possible to select a group of faces, mark them and then somehow explode-unwrap them according to the padding? I want to make this as painless as possible. 

Not only that but more seams also=more final verts so if there is an alternative solution I'm all ears.

Here is an example. I have this wardrobe I am working on and it is full of hard edges. How am I going to do this as painlessly as possible? 


Finally, I have just discovered something and I would really like a professional opinion on this. I plan to become a professional in this field and I really want to know if this is a "valid" way of doing things.

So here goes: I discovered that if I just export the low poly with smooth shading but without Auto-Smooth all the baking artifacts disappear BUT the edges have dark shading artifacts BUT only on metallic textures. Why? Does it have something to do with the Fresnel? 

I asked a professional what he thought about this and he said that if I did this for a company they would frown upon it and tell me to fix it because it messes up the normal and MIGHT cause glitches but in the viewport everything looks perfectly fine. Why does it matter if it looks messy behind the scenes?

So my question is, can I do this when I have a model that is going to have non-metallic textures such as wood and stone? For example, if I am making a gothic arch that is made of stone, can I do this?

I REALLY REALLY wish there was a comprehensive tutorial on this. I don't remember it being discussed in any of the tutorials that discuss normal maps. If I missed it, then I apologize.

Oh, one final thing. It seems my mirrored UVs don't quite match up and some faces are "swapped" when I export. Why? This causes a lot of problems in those areas. How can I fix it? 

Here is what I am talking about:

Fotografia postată de Fenes Octavian.

Fotografia postată de Fenes Octavian.

Fotografia postată de Fenes Octavian.

  • Jonathan Lampel replied

    Hey ccyberdemon1542 , hopefully I can help clear this up! 

    How am I going to make sure that when I unwrap it won't make a complete nightmarish mess? Isn't it possible to select a group of faces, mark them and then somehow explode-unwrap them according to the padding? I want to make this as painless as possible.

    Ok, so there's no way around it that I can see: you're going to have to get messy with the UV's. I've been up and down the game dev forums and the consensus is that any hard edges must be seams and sharp if you want them to appear beveled (which is the case most of the time) and shaded correctly. 

    I usually really dislike UV packing hard surface objects since it takes ages. However, I've found this addon to make it much less painful of a process. It's not perfect by any means, but I'll take it if it means saving hours of time. https://gumroad.com/l/UVShotPacker

    The Ssharp in HardOps is also nice, since you can mark all of the correct edges very quickly. 

    Not only that but more seams also=more final verts so if there is an alternative solution I'm all ears.

    There really isn't - we just need to eat the cost and take those extra verts into account. If the game is optimized properly in all the other areas, you should be totally fine. 

     I discovered that if I just export the low poly with smooth shading but without Auto-Smooth all the baking artifacts disappear BUT the edges have dark shading artifacts BUT only on metallic textures. Why? Does it have something to do with the Fresnel?

    Alrighty, now to the meat of this post. What you're mentioning here is taking a normal map that expects sharp edges and putting it on a surface with smooth edges. In this example, let's use a cube since it has 90 degree edges and shows the problem very clearly. Both have the exact same normal map, but one has sharp edges while the other one does not:

    Whether in Cycles, Eevee, or Unity, the results are similarly bad for the smooth shaded one. Even if it looks fine in Substance, it’ll look incorrect in other programs.

    Neither of these have metallic materials. The reason you're noticing it more in the metal parts is because normal maps change the direction of reflection, and naturally a metallic surface will appear more reflective. 

    Even if you bake it with smooth shading initially so that the edges aren’t messed up (which it looks like happened in the images below), you’ll end up with incorrect normals. 

    You can see the problem pretty clearly in this picture:
    What should be flat surfaces have gradients of color across the normals, meaning that they will appear curved. The fresnel and material properties of metal make the incorrect curvature more obvious, but the issue is definitely still there with non-metallic materials as well. The more reflective the surface is, the more it will look incorrect. Flat things should look flat.

    It won’t be obvious in flat lighting, but if you change the lighting, try to add flat decals, or use any custom shader that works based on normal direction, it’ll look wrong, which is why it would not be acceptable practice in a game pipeline. 

    Why does it matter if it looks messy behind the scenes?

    The problem is, it doesn’t - it looks messy right in front of the player. The messy UV’s are the behind the scenes part that should be worried about less. 

    Oh, one final thing. It seems my mirrored UVs don't quite match up and some faces are "swapped" when I export. Why? This causes a lot of problems in those areas. How can I fix it? 

    Apparently Substance is having issues with mirrored UV’s and triplanar mapping, so try switching some of the material properties from triplanar to UV projection. 

    I’m definitely glad that you’re trying new things and looking to be more efficient! This is one of those areas though that is pretty set in stone. Keep up the good work, and hopefully this helped! 

  • Fenes Octavian(cyberdemon1542) replied


    @jlampel 

    Thank you for the reply! It was very informative and I wish it could be pinned somehow so the post won't get lost. 


    One more thing though. What exactly is a hard edge? As far as I know, it's when there is a 90 degree angle between two edges? If so why do the grooves on my cylinder have the same kinds of  pixelated artifacts when baking?

  • Fenes Octavian(cyberdemon1542) replied

    @jlampel 

    I have also gotten rid of most of the baking artifacts. It's starting to look good but I still can't get specific parts of the mesh to mirror correctly. It seems like some of the faces are swapped. It doesn't have anything to do with the Tri-Planar projection as I always use UV Projection. I'm not sure if you saw it last time but when I select one part of the mesh with CTRL-R it seems like my theory is correct. See how some of the faces are not yellow? Those are the exact places that are causing trouble. I tried moving each vertex with snap to vertex but it doesn't seem to work.

  • Fenes Octavian(cyberdemon1542) replied


    @jlampel Would you mind taking a look at it? I really have no idea why the UVs don't mirror properly. I think it's definitely something I'm doing wrong in Blender because if I separate the islands it turns out ok but I really don't want to do that. 

    https://drive.google.com/open?id=1p5fSUeNGYDVLRCxYSwtmhRCtyawciQVf

  • Jonathan Lampel replied

    ccyberdemon1542 Close! A hard edge is any edge that doesn't have smooth shading. It can be at any angle. You can actually visualize how smooth vs. flat shading works in Blender if you have auto smooth on and display the vertex normal per face:


    Fun fact - looking at the images above, you can probably guess why smooth shaded objects render ever so slightly faster.

    I don't have time to look at the file this week (I'm a bit swamped), but I can try to check it out next week. 

  • Fenes Octavian(cyberdemon1542) replied


    @jlampel 


    I know you don't answer questions on weekends but I hope you haven't forgotten about my UV question. I've asked all around and no response so far. I'd also like some general feedback on the model.

    Oh, and sorry for seeming a bit slow, but I still don't understand exactly what a hard edge is.

  • Jonathan Lampel replied


    ccyberdemon1542 Sure thing, I have not forgotten! I still have a few things I need to figure out before today's stream, so I just need to get those squared away first. 

  • Fenes Octavian(cyberdemon1542) replied


    @jlampel 


    I fixed the UVs by moving the mirrored faces by 1 unit. No idea why this works though. They are basically outside the UV map. Every time I did this a new mirrored island had the same kinds of artifacts. Eventually I just did the same for all islands.

    I still don't understand hard edges though.

    The Revolver is finished! I would really appreciate some feedback https://www.cgcookie.com/t/1403-could-use-some-feedback-on-this-revolver

  • Jonathan Lampel replied


    ccyberdemon1542 Great!

    I still don't understand hard edges though.

    To save any potential confusion, lets call them sharp edges since that's more accurate. 

    Setting an object to use smooth shading makes all edges smooth. Setting an object to flat shading makes all edges sharp. 

    Setting an object to smooth shading and then auto-smoothing or manually marking edges as sharp will allow you to control which edges are smooth and which are sharp. Here's an image which shows all three in action:


    One thing to notice is that there's even an angle that's greater than 90 degrees - but that doesn't make it inherently smooth or sharp. 

    Does that visual help?