# [SlimDX] Mesh.TesselateTrianglePatch

This topic is 2853 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

What's this, what's it do (besides the obvious of "subdivide triangles") and how do I use it?

Thanks. Probably not all that important, but it's been bugging me.

##### Share on other sites
A "patch" is generally a primitive of a higher order than linear. Without checking the SlimDX documentation, I would venture a guess that this method fills the mesh with triangles that are generated by tessellating (subdividing and converting result to linear triangles) an array of patch structures.

A triangle can be thought as a type of patch too, but it only has three control points (its vertices) so the tessellation is necessarily linear between them. If you replace the triangle edges with Bézier curves, you now have more control over the surface curvature but you also need the tangent points in order to calculate any given point on the patch. The same idea applies to any patch type, not just Bézier.

The necessity to tessellate stems from the fact that the hardware takes in linear triangles. (Although some hardware, including all D3D11-class equipment, can tessellate on GPU given the control points and a suitable shader state).

I assume that there are different types of patches available in SlimDX. The combination of patch type, order and degree determines the number of control points needed to represent such a patch, so the API probably expects the data as float array in order to allow generic usage.

##### Share on other sites

A "patch" is generally a primitive of a higher order than linear. Without checking the SlimDX documentation, I would venture a guess that this method fills the mesh with triangles that are generated by tessellating (subdividing and converting result to linear triangles) an array of patch structures.

A triangle can be thought as a type of patch too, but it only has three control points (its vertices) so the tessellation is necessarily linear between them. If you replace the triangle edges with Bézier curves, you now have more control over the surface curvature but you also need the tangent points in order to calculate any given point on the patch. The same idea applies to any patch type, not just Bézier.

The necessity to tessellate stems from the fact that the hardware takes in linear triangles. (Although some hardware, including all D3D11-class equipment, can tessellate on GPU given the control points and a suitable shader state).

I assume that there are different types of patches available in SlimDX. The combination of patch type, order and degree determines the number of control points needed to represent such a patch, so the API probably expects the data as float array in order to allow generic usage.

Thanks, I now know more. Unfortunately, the internet is remarkably silent on the function itself.

##### Share on other sites
Yea, I tried to check the official docs but there is just a stub with the function protype description.

In native D3DX, there exists an equivalent function D3DXTessellateTriPatch; I would guess that the SlimDX counterpart wraps that. There are some examples of the native version on the 'net.

##### Share on other sites

Yea, I tried to check the official docs but there is just a stub with the function protype description.

In native D3DX, there exists an equivalent function D3DXTessellateTriPatch; I would guess that the SlimDX counterpart wraps that. There are some examples of the native version on the 'net.

Thanks; I found the DX function description, which had more info. Still doesn't beat actually knowing how to use it, though. Odd that it's so little known. Might try to cobble something together, but I have plenty of stuff on my plate already.

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 11
• 15
• 21
• 26
• 11