# B-Spline patches on the tessellation shader. How to get the control points

I have a polygonal mesh with ngons in it. I want to make a tessellation shader to which I send only the regular quads in such a way that it can construct a B-Spline surfaces across it. I came across the useful tutorial, but I do not completely understand it, and my problem is slightly more general in that it contains irregular polygons and vertices. In the mesh I am looking for regular quads, i.e., quads for which all vertices have valency 4. They look like this

     |    |
___|____|___
|    |
___|____|___
|    |
|    |


It is the inner face that I want the tessellation shader to divide up and then smooth using B-spline method. However, for the B-spline method I need 16 points, So I must subdivide the inner face like this

 ______         .  .  .  .
|      |        .  .  .  .
|      |   -->  .  .  .  .
|______|        .  .  .  .


I am lost on how to find these points, I can of course just use averaging to get these points but then there will be no smoothing happening. The subdivision rules I normally use are all binary, that is, they split edges into two edges, but this can not produce such a set of control points.

How do I proceed from here? Should I just resort to using quadratic B-splines, and use the top diagram to find approximations of the half way points and send those to the shader? Another issue is that adjacent faces of regular quads may very well be triangles or pentagons etc. So it is difficult to find the points I need for the tessellation shader to perform B-spline smoothing.

Thanks for any tips, if anyone would like some more clarification about the problem please ask, I realize that the question might be vague.

• Possibly helpful link if you aren't dead set on b-spline. blog.demofox.org/2015/08/09/cubic-hermite-rectangles Dec 13, 2016 at 16:25
• @AlanWolfe Thanks for the link, that looks interesting but I am looking for a smoothing effect that is gradual, i.e., Runge's phenomenon is not acceptable Dec 13, 2016 at 16:35
• @AlanWolfe I was still stuck and I checked out the article again and it actually gave me awesome results! Thanks so much for the tip. Post an answer if you want and I will accept it Dec 15, 2016 at 20:17
• I'm glad it helped, but I've never used the tesselator before, so am not able to make a decent answer. If you write one up, i'd upvote it (; Dec 15, 2016 at 21:42