• Create Account

# [SlimDX] Mesh.TesselateTrianglePatch

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

4 replies to this topic

### #1Narf the Mouse  Members   -  Reputation: 318

Like
0Likes
Like

Posted 29 December 2011 - 07:37 PM

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.

### #2Nik02  Crossbones+   -  Reputation: 2338

Like
1Likes
Like

Posted 29 December 2011 - 11:43 PM

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.

Niko Suni

### #3Narf the Mouse  Members   -  Reputation: 318

Like
0Likes
Like

Posted 29 December 2011 - 11:58 PM

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.

### #4Nik02  Crossbones+   -  Reputation: 2338

Like
0Likes
Like

Posted 30 December 2011 - 01:23 AM

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.

Niko Suni

### #5Narf the Mouse  Members   -  Reputation: 318

Like
0Likes
Like

Posted 30 December 2011 - 01:49 AM

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.

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

PARTNERS