[Test] First Contact with OpenGL 4.0 GPU Tessellation

Yesterday I released GPU Caps Viewer 1.8.9 with OpenGL 4.1 support. But, actually, the support is limited to the use of an OpenGL 4.1 context to read OpenGL caps. Not really terrible… So I decided to look at one of the killer features of OpenGL 4: the tessellation for a new demo in GPU Caps Viewer.

In short, in an GL 4 / DX11 class hardware, there are 3 units dedicated to the tessellation: two units are programmable (the tessellation control unit and the tessellation evaluation unit) and one is a fixed-function unit (the tessellation primitive generator also called the tessellator).

Here is (in an OpenGL-spec-like way) the five programmables units (vertex, tess control, tess evaluation, geometry and fragment) and the fixed-function tessellator:

My aim was to add a very simple demo in GPU Caps Viewer, a tessellated triangle, and to see if hardware tessellation worked fine on both NVIDIA GeForce and ATI Radeon cards. I’ll cover how things are done in another article more focused on shader programming (after the release of GPU Caps Viewer). In the meantime, some useful links are provided at the end of the article.

First thing: all my tests have successfully worked on a GeForce GTX 480 (with R259.09) and on a Radeon HD 5870 (with Catalyst 10.7). This is a really good start and above all, the same code works as expected and in the same manner on GeForce and Radeon. NVIDIA and AMD OpenGL driver teams have done a good job!

There are two important parameters that control the tessellation level: the outer tessellation level and the inner tessellation level. Both levels can be set at the API level (using glPatchParameterfv()) or directly in the control shader (gl_TessLevelOuter[] and gl_TessLevelInner[]).

So I played a bit with these params in the control shader. The maximum value for both levels is currently 64. Roughly said, you can divide an edge into 64 smaller parts. The following sreenshots show the tessellation for various levels:

Outer level = 1 – Inner level = 1

Outer level = 1 – Inner level = 2

Outer level = 2 – Inner level = 2

Outer level = 4 – Inner level = 2

Outer level = 4 – Inner level = 4

Outer level = 8 – Inner level = 8

Outer level = 16 – Inner level = 8

Outer level = 16 – Inner level = 16

Outer level = 32 – Inner level = 32

Outer level = 64 – Inner level = 64Click to enlarge

Here is a list of useful links. The most important is of course the big GL_ARB_tessellation_shader extension specification.