|
1 | | -# Procedural terrain with opengl |
| 1 | +# Procedural Terrain with OpenGL |
2 | 2 |
|
3 | | -// |
| 3 | +This project is a procedural terrain generation application using OpenGL, SFML and ImGui. It was developed in 2023 over two months by Valentin, Pierre, and myself as part of our studies to learn OpenGL and procedural generation techniques. |
4 | 4 |
|
5 | | -## Setting up Git dependencies |
| 5 | +You can download the game binaries from the [latest release](https://github.com/P0ulpy/procedural-terrain-with-opengl/releases/latest) |
6 | 6 |
|
7 | | -```bash |
8 | | -git submodule update --init --recursive |
9 | | -``` |
| 7 | +## Features |
10 | 8 |
|
11 | | -__Bootstrap vcpkg :__ |
| 9 | +- **Procedural Terrain Generation**: The terrain is generated using Perlin noise, allowing for realistic and varied landscapes. |
| 10 | +- **Real-time Rendering**: The terrain is rendered in real-time using OpenGL, providing smooth and interactive visuals. |
| 11 | +- **Camera Control**: Navigate the terrain using a first-person camera with keyboard and mouse controls. |
| 12 | +- **User Interface**: An intuitive UI built with ImGui for displaying information and interacting with the application. |
| 13 | +- **Skybox**: A skybox is implemented to enhance the visual experience. |
| 14 | +- **Dynamic Terrain Updates**: The terrain updates dynamically as the camera moves, generating new chunks as needed. |
| 15 | +- **Elevation-based Texturing**: Textures are applied relative to elevation, with water for low areas, grass for mid-level areas, rock for higher elevations, and snow for the highest peaks. |
12 | 16 |
|
13 | | -_Windows_ |
14 | | -```bash |
15 | | -.\vcpkg\bootstrap-vcpkg.bat |
| 17 | +## Showcase |
| 18 | + |
| 19 | +### Terrain |
| 20 | + |
| 21 | + |
| 22 | +### User Interface |
| 23 | + |
| 24 | + |
| 25 | +## Controls |
| 26 | +- **W** : Move forward |
| 27 | +- **S** : Move backward |
| 28 | +- **A** : Move left |
| 29 | +- **D** : Move right |
| 30 | +- **Space** : Move up |
| 31 | +- **Left Shift** : Move down |
| 32 | +- **Mouse** : Look around |
| 33 | + |
| 34 | +## Build from sources |
| 35 | + |
| 36 | +This repo toolchain as been created using my [cmake and vcpkg template](https://github.com/P0ulpy/cmake-vcpkg-template). |
| 37 | + |
| 38 | +### Bootstrap workspace |
| 39 | + |
| 40 | +**Windows :** |
| 41 | + |
| 42 | +Make sure you installed [Visual Studio](https://visualstudio.microsoft.com/) with [C and C++ support](https://learn.microsoft.com/cpp/build/vscpp-step-0-installation?view=msvc-170#step-4---choose-workloads) and [C++ linux development with cmake](https://learn.microsoft.com/cpp/linux/download-install-and-setup-the-linux-development-workload?view=msvc-170#visual-studio-setup). |
| 43 | +Make sure you installed [CMake](https://cmake.org/download) as well. |
| 44 | + |
| 45 | +**GNU/Linux (apt) :** |
| 46 | + |
| 47 | +Install necessary build tools and a C/C++ compiler |
| 48 | +```sh |
| 49 | +sudo apt-get update |
| 50 | +sudo apt-get install cmake build-essential tar curl zip unzip autoconf libtool g++ gcc |
16 | 51 | ``` |
17 | 52 |
|
18 | | -_Unix_ |
19 | | -```bash |
20 | | -.\vcpkg\bootstrap-vcpkg.sh |
| 53 | +Then run the bootstrap script |
| 54 | +```sh |
| 55 | +# Unix |
| 56 | +./scripts/bootstrap-workspace.sh |
| 57 | +# Windows |
| 58 | +.\scripts\bootstrap-workspace.bat |
21 | 59 | ``` |
22 | 60 |
|
23 | | -## Installing dependencies |
| 61 | +**Generate the cmake project :** |
| 62 | + |
| 63 | +```sh |
| 64 | +# For debug build |
| 65 | +# Unix |
| 66 | +./scripts/generate-cmake-debug.sh |
| 67 | +# Windows |
| 68 | +.\scripts\generate-cmake-debug.bat |
| 69 | + |
| 70 | +# For release build |
| 71 | +# Unix |
| 72 | +./scripts/generate-cmake-release.sh |
| 73 | +# Windows |
| 74 | +.\scripts\generate-cmake-release.bat |
| 75 | +``` |
24 | 76 |
|
25 | | -Install dependencies : |
| 77 | +**Compile :** |
26 | 78 |
|
27 | | -_Windows_ |
28 | 79 | ```bash |
29 | | -.\vcpkg\vcpkg.exe install --triplet x64-windows |
| 80 | +# For debug build |
| 81 | +# Unix |
| 82 | +./scripts/build-debug.sh |
| 83 | +# Windows |
| 84 | +.\scripts\build-debug.bat |
| 85 | + |
| 86 | +# For release build |
| 87 | +# Unix |
| 88 | +./scripts/build-release.sh |
| 89 | +# Windows |
| 90 | +.\scripts\build-release.bat |
30 | 91 | ``` |
31 | 92 |
|
32 | | -_Linux_ |
| 93 | +**Run the program** |
| 94 | + |
| 95 | +You can now run the compiled program by looking into `out/Debug` or `out/Release`. |
| 96 | +The out directory hierarchy will be different depending on your generator. |
| 97 | + |
| 98 | +For exemple with Make generator in Debug mode run your program like that |
33 | 99 | ```bash |
34 | | -./vcpkg/vcpkg install --triplet x64-linux |
| 100 | +# Unix like |
| 101 | +./out/Debug/Game/Game |
| 102 | +# Windows |
| 103 | +.\out\Debug\Game\Game.exe |
35 | 104 | ``` |
| 105 | + |
| 106 | +## License |
| 107 | +This project is open-source and available under the MIT License. See the [LICENSE file](LICENSE) for details. |
| 108 | + |
| 109 | +## Acknowledgments |
| 110 | +- This project was developed as part of our studies to learn OpenGL and procedural generation techniques. |
| 111 | +- Special thanks to our instructors and peers for their support and feedback. |
0 commit comments