Skip to content

Procedural terrain generation and rendering in openGL using compute and tesselation shaders.

Notifications You must be signed in to change notification settings

Netrunner54/ProceduralTerrainGeneration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Procedural Terrain Generation

This project was created for learnig purposes. It uses compute shaders to generate random terrain and tesselation shader to render it in high resolution.

Controls

W A S D to move along x/z axis.
SPACE LCTRL to move along y axis.
LSHIFT to move faster.
MOUSE to look around.
R to generate new random terrain.
F to render in wireframe mode.
H To switch between "rendering in high quality" and "optimized rendering".
ESC to exit.

Screenshots

1 2

Terrain Generations

Terrain is generated in compute shaders for efficiency. 3 textures are used to describe the terrain. Firstly height map is generated from perlin noise, than normal and diffuse maps are generated from height map.

Rendering

Tesselation

If optimize rendering is allowed terrain closer to the camera will be more tesselated than terrain further away.

Normal mode Wireframe mode
normal_mode wireframe_mode
normal mode_2 wireframe mode_2

Normal mapping

For realistic lighting normal maps are used. Below you may see the difference between rendering with normal maps (on the left) and without them (on the right). with_and_without_normal_mapping

Build on Windows

Run premake.exe vs2022 to generate Visual Studio 2022 solution.

Dependencies

Used libraries - glad
- glfw
- glm

About

Procedural terrain generation and rendering in openGL using compute and tesselation shaders.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages