Why no angle based subsurf mode?

I don’t know if I ever posted a thread to discuss this in the past, but the curiosity has definitely been on my mind since forever. Currently Blender has two methods of preforming Subdivision Surface operations on meshes: The classic one is a fixed number of subdivisions, meaning twice more vertices are going to be added everywhere on the mesh. The newer one is adaptive subsurf which is unfortunately still just an experimental feature in Cycles, adding vertices based on the view distance and render resolution.

Both methods share a common problem although they distribute it in different ways: You need to add a lot of vertices to avoid sharp edges, but when you do everything becomes really slow! This is an unavoidable issue of 3D rendering for obvious reasons… however I believe there is a way to deal with it far more efficiently: Subdividing a mesh only in the parts where more detail is needed! It’s a very simple concept, yet to my surprise I’ve never seen any attempts to get such a thing implemented.

Imagine having a complex mesh with both smoother / rounder and sharper / squarer areas, like say the monkey head. When used with this feature, the subsurf modifier would have a maximum number of subdivisions but only apply them where necessary: In smooth areas like say the top of the monkey’s head, it might only apply 1 subdivision since that’s already smooth enough… in places like the ear tips where there’s more sharpness however, it could apply 2.

The algorithm would only need to detect how sharp an angle is between two connected faces, an ability already present in the Decimate modifier; If an edge is too sharp or a vertice is too pointy, only subdivide the faces neighboring that edge / vertice around that connection point. If a surface is flat enough, that part may not need to be subdivided in the first place… a series of planes (flat relative to each other) would never be touched for instance. Since the resulting distribution of vertices won’t be even, the faces connecting subdivided and untouched areas will need to be either triangulated or use n-gons… a small annoyance but decent price to pay for such a feature (especially when it’s a non-destructive modifier so the original mesh remains all quads).

Regarding the settings I’d have 3 options for this mode: Min angle, max angle, max subdivisions. So if you gave it: 10*, 50*, 3: Edges sharper than 10 degrees will be subdivided once, those sharper than 30 will be subdivided twice, those sharper than 50 would be subdivided three times.

The advantage? Artists could get away with far less vertices and wasting fewer seconds for the same visual gain! Subdivisions are only needed in round areas where you don’t want to see low-resolution ridges, if a surface connection is fully or almost flat there’s no need to subdivide there. Yet both classic and adaptive subsurf add vertices everywhere indiscriminately which is a big waste of resources.

The bevel modifier kind of already does what I’m thinking of, when used with the angle limit option. It is however meant for other purposes and will create edges where none are desired… also you can only give it a fixed number of segments, they don’t vary based on the sharpness of each zone. Perhaps some of its code can be reused to create a hybrid between it and the subsurf modifier?

1 Like

Often when nobody’s implemented such a “simple idea” in twenty-five years of Blender’s existence, it’s because it’s not simple at all.
Of course it’s a good idea, I don’t want to dismiss it right off the bat, but I can think of two dealbreakers off the top of my head. First off, you would get n-gons at the limit (where two patches with different subdiv levels meet). N-gons are implicitly triangulated, which results in shading artifacts as soon as they’re not perfectly flat, and I assume we’re not talking about this corner case. I mean you did mention it but that’s not the goal of the method you suggest. In any case I think a clean surface is necessary, I know I wouldn’t give up that, it’s the basics.

The second issue I can see is that of performance : such a system would require a continuous analysis of the model, on every frame change, in order to distribute subdivisions “where needed” (ie where there is curvature), and I imagine such a system would cost quite a lot. Now there is OSD’s dynamic tesselation which does something similar, but it does so with surface proximity to the camera, which is probably much cheaper… I am no specialist but I guess unless a screen space approximation of curvature is used (which might be fast enough for viewport playback, but inaccurate and not accounting for offscreen or occluded surfaces), it would be rather costly.

To be frank though there are outstanding issues with subdivision in current Blender 2.8x. It is actually slower than previous versions, and does not take advantage of GPU acceleration with OSD (which it did in 2.7x!), so great improvements are to expect in that area.


have you ever heard of edge creases?

Those are good points. Regarding n-gons / triangulation I was aware it’s a logical consequence of having to connect areas with uneven subdivisions… I noticed they can have weird shading artifacts so it would be a price of using this method. As far as analysis goes, the Decimate modifier already does angle based operations on a mesh… to be fair I did notice (to my own surprise) that it’s often slower to use it and get rid of many vertices than to not use it at all and keep all those extra vertices, so that’s a good point if the algorithm isn’t fast enough (though in this case I’m not sure if it’s because of having to calculate the initial high-poly mesh first rather than just angle sharpness).

I wasn’t aware of that issue, really hope this performance decrease can be recovered in new 2.8 releases. I too got the feeling Blender slows down too much when you add a lot of vertices for what should happen on a modern computer, which is actually what pushed this idea back to my mind… initially I figured that’s normal and there’s no way to further improve vertice calculations. If performance with many vertices can be improved, the effort is indeed better spent there.

I use edge creases occasionally. They’re more similar to the bevel modifier in this case, except even less vertex efficient: If you crease all the edges of the default cube to 0.5 then add a subsurf with a value of 4, you can see it adds pointless vertices to the areas that remain flat too. So it’s not doing the vertice saving technique I was thinking of.

Yes, I have to agree, as some one who has used B for 15 years now, I never understood that. I rarely ever do ‘Organic’ stuff, I’m 95% hard surface, and the SubD works great for organics but not so much for hards - I like the angle based concept, but having a modifier just for hard surface stuff would be a very welcomed addition.

1 Like