This program is nearly identical to the one in the Tessellating a 3D surface recipe. The only difference lies within the TCS. We'll remove the TessLevel uniform variable, and add a few new ones that are described as follows:
- MinTessLevel: This is the lowest desired tessellation level
- MaxTessLevel: This is the highest desired tessellation level
- MinDepth: This is the minimum distance from the camera, where the tessellation level is maximal
- MaxDepth: This is the maximum distance from the camera, where the tessellation level is at a minimum
Render your objects as 16-vertex patch primitives as indicated in the Tessellating a 3D surface recipe.