Triangulate a square with a hole in it using tessellation

Is it possible to triangulate an ATV with a hole in it using a tessellation shader? For instance,

enter image description hereenter image description hereenter image description here

  • Imagine I have a Quad.
  • Then I want to make a hole in the center of the ATV.
  • To make this hole, there must be many more vertices.

And questions:

  • Can I do this with the Tessellation shader? If so, how?
  • Should the geometry shader be used instead?
+4
source share
1 answer

This is not a typical application of the tessellation shader, and it is also not what is done. Basically, you have a crude 3d model that is transferred to your graphics card. The graphics card actually implements the tessellation algorithm, which creates a more advanced 3d model by tessellating primitives.

You need to provide two shaders: control and evaluation shaders (in terms of OpenGL)

In the shader control shader, you can "parameterize" the tessellation algorithm (internal and external tessellation factors, etc.). Then the tessellation algorithm is applied. After that, the tessellation scoring estimation shader is used, for example, to interpolate vertex attributes for thin vertices.

What you want to do is remind me of CSG ( http://en.wikipedia.org/wiki/Constructive_solid_geometry ). It is true that the tessellation shader creates new data, but you can simply parameterize the algorithm. You cannot "implement" the tessellation algorithm. Ad Geometry shader: it is true that you can emit (a limited number) new primitives, but this also does not apply to your problem.

+2
source

Source: https://habr.com/ru/post/1481571/


All Articles