Jump to content
  • Advertisement
Sign in to follow this  
Narf the Mouse

[SlimDX] Mesh.TesselateTrianglePatch

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!