Skip to main content
gamedev.net
🔒 Locked

[SlimDX] Mesh.TesselateTrianglePatch

Started by Narf the Mouse Dec 30, 2011 at 1:37 AM 3 replies 900+ views
Original Post
Narf the Mouse
Narf the Mouse
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.
Nik02
Nik02
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
Narf the Mouse
Narf the Mouse

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.
Nik02
Nik02
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
Narf the Mouse
Narf the Mouse

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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.