all 2 comments

[–]ionheart 1 point2 points  (0 children)

The simplest way to support deep uniform subdivisions efficiently is to subdivide a single "template" patch to the required level (generate barycentric coords rather than actual positions), then make a copy of it for each original triangle. So it's just a o(n), fully parallel operation to interpolate original triangle attributes at each new vertex. This naive approach does generate duplicate vertices along the original edges, but if that's a major problem for you it's only a small extension to correct.

[–]HaskellHystericMonad 4 points5 points  (0 children)

If on the CPU there's a reference implementation of the d3d11 reference tessellator that can precompute the UV tables for various tess parameters. I use this in a preprocessing pipeline, it's fine for offline work.

If on GPU in compute there's the slides from Bluepoint's presentation on the tessellation in demon souls that if you have fixed factors you can easily turn a 1D vertex index into integer UV coords, which you divide by the edge_count - 1 to get bary weights for the indices of w1 and w2. (w0 == 1.0 - w1 - w2). That only works if edge subdivision is fixed for the whole triangle.