Camera position
Currently located at (vec3)(0.0f, 0.0f, 3.0f); y=0
In the tessellation evaluation shader, the height (y coord) is added using the heightMap and it is scaled and shifted.
// Comment from the reference learnopengl.com page
// lookup texel at patch coordinate for height and scale + shift as desired
// height_map provides values in range [0.0-1.0]
// scaled by 64.0, range [0.0,64.0]
// offset by -16.0, range [-16.0, 48.0]
height = texture(height_map, tex_coord).g * 64.0 - 16.0;
vec4 p_00 = gl_in[0].gl_Position;
vec4 p_01 = gl_in[1].gl_Position;
vec4 p_10 = gl_in[2].gl_Position;
vec4 p_11 = gl_in[3].gl_Position;
vec4 u_vec = p_01 - p_00;
vec4 v_vec = p_10 - p_00;
vec4 normal = normalize( vec4(cross(v_vec.xyz, u_vec.xyz), 0) );
vec4 p_0 = (p_01 - p_00) * u + p_00;
vec4 p_1 = (p_11 - p_10) * u + p_10;
vec4 p = (p_1 - p_0) * v + p_0 + normal * height; // normal is Y axis, scaled by range [-16.0,48.0]
gl_Position = projection * view * model * p; // position has a y coord in range [-16.0, 48.0]
The camera should be above y=48.0 to avoid looking the mesh from below. The map is very huge 2624x1744 (height_map size). You should also increase the Far plane (100.0f) to look more terrain and avoiding the clipping with far plane.
glm_perspective(glm_rad(ccamera->zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f, projection);