Is it possible to triangulate a quad with a hole in it using tesselation shader? For example,
And the questions:
That is not a typical application of the tessellation shader, and that's also not what is done. Basically, you have a coarse 3d model, which is passed to your graphics card. The graphics card actually implements the tessellation algorithm, which creates a more refined 3d model by tessellating the primitives.
You have to supply two shaders: Tessellation control- and evaluation shaders (in OpenGL terms)
In the tessellation control shader you can "parameterize" the tessellation algorithm (inner and outer tessellation factors etc). Then the tessellation algorithm is applied. Thereafter the tessellation evaluation shader is used to, e.g. interpolate vertex attributes for the fine vertices.
What you want to do reminds me of CSG (http://en.wikipedia.org/wiki/Constructive_solid_geometry). It's true that the tessellation shader creates new data, but you may just paramterize the algorithm. You cannot "implement" the tessellation algorithm. Ad Geometry shader: it's true that you can emit (limited amount of) new primitives, but it also does not apply to your problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With