6
$\begingroup$

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.

$\endgroup$
  • 1
    $\begingroup$ Possibly helpful link if you aren't dead set on b-spline. blog.demofox.org/2015/08/09/cubic-hermite-rectangles $\endgroup$ – Alan Wolfe Dec 13 '16 at 16:25
  • $\begingroup$ @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 $\endgroup$ – Slugger Dec 13 '16 at 16:35
  • 1
    $\begingroup$ @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 $\endgroup$ – Slugger Dec 15 '16 at 20:17
  • $\begingroup$ 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 (; $\endgroup$ – Alan Wolfe Dec 15 '16 at 21:42
3
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.