Geometry clipmap to represent procedural FBM terrain that uses analytical normals.
terrain3
procedurally generates terrain and represents it with varying levels
of detail using a geometry clipmap. The terrain itself is created using
fractional Brownian motion where the accumulated derivative of the noise values
is used to scale the accumulated values. The analytical derivative of the
terrain is found, using which the normal of the terrrain is calculated with
little to no additional overhead. The terrain height and gradient values are
calculated using an OpenGL compute shader.
ENTER
for a demo.F1
, F2
, F3
, F4
to toggle wireframe, debug drawing, terrainAt its most detailed level, the terrain is represented with a resolution of
ten centimeters. The above image displays movement at about 200 meters per
second, which a system with a Ryzen 5 2600 and an RTX 2070 takes roughly
0.013-0.017
ms to update the terrain and 0.14-0.18
ms to render it at 1080p.
Windows 10 and C++17. Building is tested with MSVC, but other compilers should work as well. The following third-party dependencies are included: