How to auto-smooth in Geometry Nodes?

I can't seem to figure out how to Auto Smooth objects in Geometry Nodes. Here's a setup with a simple cylinder in three different states:

In the first image, setup seems to shade the top face flat as it should (since its edge angles are smaller than 40°), but sides stay faceted. I need to increase the Edge Angle to at least $$50.626°$$ to get the sides shaded smooth, but then it looks like it doesn't take top edges into account at all. In addition to that, I also need to enable Auto Smooth in Object Properties to get the desired result. That would be OK, but there's another problem. Enabling Auto Smooth only works if you're only manipulating a real mesh from the Group Input and if you don't have any geometry created inside the GN network itself:

As you can see, as soon as I add a mesh primitive to the network, Auto Smooth stops working. Which all makes me think I'm missing some knowledge about how shading works under the hood—or this is a bug/shortcoming?

Join Geometry order seems to matter (which is weird):

• ...strange, I can't reproduce this. Which Blender version are you using? I am using Blender v3.1 and it works without problems and also with geometry created inside GN. Apr 6 at 18:59
• @quellenform Really? I'm using 3.2 but when I try it with other versions (including a clean 3.1 with no addons installed or settings changed) I still get it. In fact, just now I noticed an even weirder thing, it works and stops working based on which geometry is linked first to the Join Geometry node!! i.imgur.com/hUIHXjY.mp4 Can you reproduce that? Also, do you not even get the edge angle stuff (50.626)? Does my first screenshot above give you a normal auto smooth result? Apr 6 at 19:12
• Yes, i can confirm that: If I change the order in "Join Geometry", the result changes. I couldn't see that in your screenshot. Strange. Looks like a bug indeed. Apr 6 at 19:35
• Yeah I couldn't see that as well, I guess because I normally use straight noodles. Could you answer my other question? Can you get a normal smooth surface with less than 50.626 degrees? It's a cylinder with 32 vertices so it should theoretically work with 11.25 degrees, I have no idea where 50.626 comes from. I'll make a bug report if you can confirm that too. Apr 6 at 19:39
• The documentation says that it uses "simple domain interpolation", whatever that means. But why 50,625? If you use a cylinder with 4 sides the angle is 90°, exactly what i would expect. Apr 6 at 20:04

This Answer is now to be understood as a Note after a revision, and was not deleted only because possibly still something useful could be found in it.

It should be noted that:

1. In any case the object must have Shade Smooth activated, otherwise all faces will always be displayed flat.

2. If Auto Smooth is not activated, all normals will always be interpolated over the entire object.

The angle used here for Auto Smooth therefore defines which faces should be smoothed.

If Auto Smooth decides on the basis of the angle that no smoothing should be applied to a face, the Set Shade Smooth node will have no effect because the normals will not be calculated accordingly.

3. If you join an existing geometry with a generated geometry in the Geometry Nodes using Join Geometry, the order is obviously decisive:

• If one adds the geometry generated using Geometry Nodes after the existing geometry, the settings under Auto Smooth are also applied to the added geometry.
• However, when adding an existing geometry to a geometry created using Geometry Nodes, no Auto Smooth is applied.

So the settings for Auto Smooth are always taken from the first object and applied to each added geometry.

This is probably more of a bug, and may not be quite what the user would expect.

4. As you can read in the Documentation, you always get an interpolated angle with the node Edge Angle except in the Edge domain: "For the Face, Face Corner, and Point domains, the node uses simple domain interpolation to move values from the mesh's edges."

To better understand the interpolation of angles by "Auto Smooth", the following illustration helps:

• Thank you for the write-up. As far as I can understand, your answer boils down to "you can't, unless you use the original geometry in first order in a Join Geometry node" and this is because normals are not calculated for shading purposes in GN at all. Practically I was already aware of this as we've already talked about in the comments, and I'm not really sure about the explanation "because there's no Set Normals node" (not because I don't believe it, but because I don't have enough technical understanding of it). Apr 8 at 16:01
• By "because there's no Set Normals node" I meant that you do have a node with which you can read the normals of your domains, but you can't change them directly via a node (like "Set Position"). But I think you are right: the fact that the order is crucial points at least partly to a misbehavior/bug. Apr 8 at 16:06
• It's also still unclear why faces at 90d angles gets smoothed correctly by the node, but ones with shallower angles don't. PS about your setup: if I'm not mistaken, you don't need a Capture Attribute node? Directly linking Edge Angle to it like I do is enough (at least I can't see a diff when I unplug it). In fact, if you want auto-smooth behavior, you don't need Edge Angle at all, you just need the original geo at the top of Join, and Auto Smooth enabled. Edge Angle either makes things worse or doesn't do anything at all. It all looks like a bug/missing feature situation, in the end. Apr 8 at 16:12
• Hmm, I think you are partially right. There are still some interesting things here. My answer is also not completely correct, must revise it. What I find strange: "Auto Smooth" does not change the angle in "Edge Angle", but the result in the shader. And "Edge Angle" always returns the interpolated value in all cases (which doesn't seem to make much sense), unless you use "Capture/Transfer Attribute" from the Edge domain like i did... Apr 8 at 17:07
• In any case, I think I'll prepare bug reports so the devs can tell us what's going on if it's not a bug, or they can fix it if it is. I'm thinking of two reports: one for Join Geometry order affecting Auto Smooth results, and another for Edge Angle not responding correctly, in case these are separate issues. Any thoughts on that? Apr 8 at 17:53