[TEST] Hardware Tessellation on Radeon in OpenGL (Part 1/2)
- Hardware Tessellation on Radeon in OpenGL (Part 2)
- Hardware Tessellation on Radeon in OpenGL (Part 3)
Update (2010.02.10): AMD provided me some important details about tessellation on Radeon. You can read these details HERE.
I recently played with the hardware tessellation unit included the Radeon HD 5770. Actually this unit is included in all Radeon HD 2000, 3000, 4000 and 5000 series.
Tessellation on Radeon – Theory
The tessellation is the processus that divides a polygon into smaller ones. Another definition is: tessellation allows to increase polygons density. Today tessellation can be done on GPU and provides several key benefits:
- Compression: using tessellation allows to reduce the memory footprint and bandwidth consumption by storing on disk only low resolution meshes.
- Bandwidth is improved because, instead of transferring all of the vertex data for a high-polygon mesh over the PCI-E bus, only the coarse mesh is sent to the GPU.
- Scalability: because of its recursive nature, subdivision naturally accommodates LOD rendering and adaptive approximation with a variety of metrics.
In old hardware like Radeon 8500 or Radeon 9800, there was a hardware tessellation module called TruForm. In OpenGL, TruForm functionality was accessible via the GL_ATI_pn_triangles extension. TruForm was designed for organic shapes. But AMD has removed the support of TruForm from Catalyst a long time ago so today we can ignore it.
Instanced tessellation is another technique that performs tessellation by rendering a single tessellated quad multiple times, using instancing to do this in a single call. This tessellation method does not require a hardware tessellation unit but requires more code.
Now let’s quickly see the tessellation in recent Radeon cards.
In Radeon HD 2000, 3000 and 4000 series, the tessellation unit or tessellator is placed before the vertex shader (DX10 architecture):
In Radeon HD 5000 series (DX11 architecture), the tessellator is placed after the vertex shader and comes with two new programmable units: the hull shader and domain shader.
The tessellation hardware in DX9/DX10 is a subset of the full tessellation unit of DX11. In both cases, the tessallator is a fixed function unit. You can’t program it with a shader.
In OpenGL, AMD Catalyst driver exposes the GL_AMD_vertex_shader_tessellator extension that allows to tweak the tessellator via 2 functions:
- glTessellationFactorAMD(GLfloat factor)
- glTessellationModeAMD(GLenum mode)
glTessellationFactorAMD specifies the amplification factor that allows to control the level of tessellation. The minimum value is 1.0 and the maximun value depends on the architecture / 3D API used: 15.0 in DX9 and DX10 and up to 64.0 in DX11.
glTessellationModeAMD specifies the tessellation mode: discrete or continuous. Discrete mode allows to use only integer part of the tessellation factor: 1, 2, 5, 10 or 15 for example. Continuous mode allows to use real float factor: 1.0, 1.2, 4.3, 12.7 or 15.0 for example. Continuous mode is well adapted for LOD algorithms.
In the part 2, we’ll see the tessellation in action on a Radeon HD 5770.