Search code examples
c++c++11openglshadertesselation

C++/OpenGL: How does Tesselation work?


I've got the book "OpenGL SuperBible Seventh Edition" and I'm now wondering how the tesselation works? I'm currently in chapter 3 of the book and I do not really understand the explanation of the tesselation with the tesselation control shaders, the tesselation engine and the tesselation evaluataion shaders.

So I'm using

  • OpenGL 4.5
  • C++11
  • Windows

Can anyone explain to me in detail how tesselation works in OpenGL 4.5 and what control points, batches etc. are?

EDIT: Ok, I think I have to ask in more detail.

  • What is an "high-order primitive"?
  • What are "quadrilaterals"?
  • What are those "control points" from which a patch is formed?
  • What are "batches"? (The book explains that the tesselation control shader runs in batches on groups of control points where the size of each batch is the same as the number of vertices per patch.)
  • What is a "barycentric coordinate".

I think that makes it more clear what my problem and question is.


Solution

  • The 6th edition SuperBible has a cubic Bezier patch example, which I'm guessing will still be in the 7th. Using that to answer your questions

    High order primitive: anything more complicated than a triangle. In this case a Bezier patch. Quadrilateral: 4 vertices forming flat polygon Control points: the 4x4 = 16 vertices forming a single Bezier patch Batch: the Bezier patch. Barycentric coordinate: not important

    Computer graphics is a subject where you can always see the results of what you do. I suggest less thinking, more coding.