Skip to content

Repository files navigation

Terrain Engine ⛰️

Project overview

This project implements a terrain engine, compiled into a standalone executable. Basic goal is rendering a 3D scene that contains a skybox, water, and terrain, with an ability to fly around. Then, advanced features, such as lighting, shadows, weather and dynamic waves, add more realism into it.

The engine is written in C++ and uses OpenGL 3.3 as its rendering backend (core profile, enabling full control over the graphics rendering pipeline), with GLSL for programmable shaders.

Result


Terrain entities:

  • Camera – system that emulates first-person view camera (fly around + look around + zoom)
  • Skybox – large cube that encompasses the entire scene and contains 6 images of a surrounding environment
  • Water – dynamic surface generated as 3D Gerstner waves
  • Terrain – 3D mesh generated from a height map
  • Lighting – Phong lighting model (ambient + diffuse + specular lighting) and shadows
  • Weather – particle emitters for fog and rain

Folders structure:

  • aux_docs – auxiliary project files
  • data – texture images
  • shaders – GLSL shaders source code

Manual

Install dependencies
sudo apt-get install mesa-utils mesa-common-dev libglu1-mesa-dev freeglut3-dev – core OpenGL utilities (libraries for rendering, handling windowing and output)
sudo apt-get install libglew-dev libglfw3-dev libglm-dev – advanced development libraries (GLEW, GLFW, GLM)

Compile and launch
g++ main.cpp -o app -lglfw -lglad
./app

Keyboard controls:
W A S D – camera movement
- + – wave height control
N – enable / disable weather
L – enable / disable lighting
M – show / hide light cube
F – fullscreen mode
Escape – exit

About

Terrain Engine – project for Fundamentals of Computer Graphics course (2025 Spring Tsinghua)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages