How to smooth shade an object while retaining hard edges?

  • I frequently come to the problem of having a mesh with parts I would like to render smooth and "hard" edges connecting them.

    How can I set the mesh to show the sharp edges but render everything else smooth?

    In the example I would like the sides of the individual cylinders render smooth but the intersection between bottom and top to be sharp/flat

    flat set to smooth

    Thanks for the answers, I guess both are really good depending on the situation.

  • iKlsR

    iKlsR Correct answer

    7 years ago

    There are a few ways to do this but the quickest and most efficient (in your case here) is to just smooth it the same way, using Shade Smooth and then adding an Edge Split modifier to the mesh.

    From the wiki

    The EdgeSplit modifier splits edges within a mesh. The edges to split can be determined from the edge angle (i.e. angle between faces forming this edge), and/or edges marked as sharp.

    Splitting an edge affects vertex normal generation at that edge, making the edge appear sharp. Hence, this modifier can be used to achieve the same effect as the Autosmooth button, making edges appear sharp when their angle is above a certain threshold. It can also be used for manual control of the smoothing process, where the user defines which edges should appear smooth or sharp

    Here it is as you have it above..

    enter image description here

    With the modifier added

    enter image description here

    Additionally, you can see some more tips here for getting good quality on hard surface models. BlenderCookie has a tutorial (archived) on getting nice sharp edges.

  • While what iKlsR says is indeed the most efficient, it's often preferred to either add edge loops on both sides of the hard edge, or bevel it (Ctrl + B). When smooth shaded this produces a more realistic surface since there's seldom any truly sharp corners in reality, and also catches specular highlights nicely showing off the model better.

    Beveled corner with wireframe

    Close-up

    Note that the Edge Split modifier shouldn't be used when beveling or using edgeloops to sharpen corners. Edge Split physically cuts the model to fake a sharp corner, whereas beveling actually creates the corner.

    It is perhaps useful to mention to the reader that the _EdgeSplit_ modifier and _Bevelling_ operations are not mutually exclusive techniques. Doing manual bevels helps guide the transition from smooth to flat in those sections where _EdgeSplit_ produces unnaturally abrupt transitions.

    For anyone really new to Blender -- Bevel is a modifier. Look for it there.

  • As of this commit (will be in blender 2.71), blender has support for split normals.

    This is basically like the old Autosmooth, but it works in Cycles and the viewport in addition to BI.

    If you don't know what Autosmooth is, it behaves like the edge split modifier, but without actually splitting edges:

    enter image description here

    There is no edge split modifier used in the above screenshot.

    This is amazing. It fixed all my shading problems caused by subdiv / 1.0 creases at once.

    This should actually be the top answer, or the accepted answer should be updated.

    as of 2.80, does this work with Eevee too?

    @Luciano yes, it should. The setting is in the same place as well iirc

  • Another thing that you can do is - In Edit mode hit "W" and there you have "Shade flat" and "Shade smooth" You can just select the parts of your object that you want them to be smooth and press on "Shade smooth". enter image description here

  • The following method is probably best for real-time (e.g. games) and low-poly work in particular.

    Gandalf3 mentioned the new Autosmooth feature, but I'd like to add that with it enabled, you can manually select faces, edges and vertices that you would like to be hard - the Autosmooth 'Angle' setting merely creates a base smoothing to work from. If you then go into edit mode and look in Shading / UVs > Shading, there are options to mark vertices, edges and faces. With Autosmooth disabled, you can see the edges/vertices you have marked, but they will not be rendered flat, but when Autosmooth is enabled, they will be rendered correctly.

    Autosmooth: Manual marking

    As Gandalf3 mentions, unlike the split edges modifier, Autosmooth does not physically split elements in order to get hard edge lighting, so is ideal for low-poly work, and seems to be designed for better compatibility with the FBX and OBJ formats, which are commonly used in games.

  • Another simple way to do this would be to select the faces that you want smooth (in this case the non-horizontal surfaces) and select Shading: Smooth in the tool panel. Then, select the faces that you want sharp (horizontal surfaces, in this case) and select Shading: Flat.

    It probably won't give as nice results as Greg's method, but it might be quicker and simpler.

    This is a useful method if you need a lowpoly mesh to import into i.e. Unity. Just make sure to import tangents.

    @NoviceInDisguise It seems to work fine for me in 2.73: http://i.stack.imgur.com/4XqVR.png

  • Just to be complete:

    The first and original method to achieve that is still there: Autosmooth. It works like an Edge Split set to Edge Angle. The drawback is that the effect isn't visible in the viewport. The modifier is somwhat superior by now.

    enter image description here

    This answer is now outdated.

License under CC-BY-SA with attribution


Content dated before 6/26/2020 9:53 AM