Terrain interpolation
An OpenGL proof of concept of a procedural terrain interpolation algorithm, documented in French.

At a glance
- C++, OpenGL
Tags
A proof of concept for terrain interpolation, built with OpenGL, GLFW and GLM. The documentation is in French and most comments are in English.
The idea
The goal is to generate a terrain procedurally from a mesh of points of very low resolution, using surface subdivision. The plan was to implement Loop subdivision; for lack of time, a simplified version stands in for it: each triangle gets three new vertices, and a blurring pass then averages the vertex attributes to smooth the result.
Three stages show the difference: without any algorithm, the terrain is very angular and of low resolution; with naive subdivision it is just as angular but finer; with subdivision and blurring it comes out smooth. A high-frequency noise can then be added to imitate the irregularities of the ground.
Using it
The program shows a random terrain of ten by ten points, with its normals drawn in red. The arrow keys rotate the camera, Z and S zoom, and plus and minus raise or lower the level of detail, which is the number of subdivision passes. Faces can be coloured by normal and height, and lit with a day and night cycle.
The author notes that improvements are conceivable, such as simulating erosion or generating more precise textures and normals.

