<p>For regular quad faces, what you want to do is send the vertices for the quad you're evaluating <em>and</em> the eight neighboring quads around it: a total of 4x4 vertices. The B-spline needs to know where the neighboring vertices are in order to generate a surface patch that connects smoothly to the neighboring patches.</p>

<p>In the case that the adjacent faces aren't quads, I don't think you can use the straightforward B-spline evaluation. In Catmull-Clark subdivision, everything is quads after the first level of subdivision, though you'll still have extraordinary vertices to deal with.</p>

CC BY-SA 3.0
2016-12-13T18:29:07.240Z
2016-12-14T04:28:37.033Z
2016-12-14T04:28:37.033Z
Nathan Reed
<p>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 <a href="http://prideout.net/blog/?tag=tessellation-shaders" rel="noreferrer">tutorial</a>, 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</p>

<pre><code>     |    |
  ___|____|___
     |    |
  ___|____|___
     |    |
     |    |
</code></pre>

<p>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</p>

<pre><code> ______         .  .  .  .
|      |        .  .  .  .
|      |   --&gt;  .  .  .  .
|______|        .  .  .  .
</code></pre>

<p>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. </p>

<p>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.</p>

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

CC BY-SA 3.0
2016-12-13T16:25:09.393Z
Possibly helpful link if you aren't dead set on b-spline.  http://blog.demofox.org/2015/08/09/cubic-hermite-rectangles/
Alan Wolfe
CC BY-SA 3.0
2016-12-13T16:35:42.360Z
@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
Slugger
CC BY-SA 3.0
2016-12-15T20:17:04.853Z
@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
Slugger
CC BY-SA 3.0
2016-12-15T21:42:11.090Z
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 (;
Alan Wolfe
<shader><subdivision>
B-Spline patches on the tessellation shader. How to get the control points
Slugger
# B-Spline patches on the tessellation shader. How to get the control points

(Asked by: username_0 on 2016-12-13)

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](http://prideout.net/blog/?tag=tessellation-shaders), 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.

**Tags:** shader, subdivision

> **Comments:**
> **username_1**: Possibly helpful link if you aren't dead set on b-spline.  http://blog.demofox.org/2015/08/09/cubic-hermite-rectangles/  
> **username_0**: @username_1 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  
> **username_0**: @username_1 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  
> **username_1**: 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 (;  

---

## 1 answers

### Answer by username_2 on 2016-12-13. Score: 2

For regular quad faces, what you want to do is send the vertices for the quad you're evaluating *and* the eight neighboring quads around it: a total of 4x4 vertices. The B-spline needs to know where the neighboring vertices are in order to generate a surface patch that connects smoothly to the neighboring patches.

In the case that the adjacent faces aren't quads, I don't think you can use the straightforward B-spline evaluation. In Catmull-Clark subdivision, everything is quads after the first level of subdivision, though you'll still have extraordinary vertices to deal with.


---

