Skip to content
This repository was archived by the owner on Nov 17, 2024. It is now read-only.

Commit f4a1870

Browse files
committed
Update ReadMe.md
1 parent 39104be commit f4a1870

File tree

5 files changed

+105
-24
lines changed

5 files changed

+105
-24
lines changed
2.89 MB
Loading

.github/images/user_interface.png

13.3 KB
Loading

Game/Assets/Shaders/terrain.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ vec3 Lights(vec3 normal) {
2222

2323
vec3 viewDir = normalize(lightPos - FragPos);
2424
vec3 reflectDir = reflect(-lightDir, normal);
25-
float spec = pow(max(dot(viewDir, reflectDir), 0.0), 32.0);
25+
float spec = pow(max(dot(viewDir, reflectDir), 0.0), 8);
2626

2727
vec3 ambient = 0.1 * vec3(1.0, 1.0, 1.0);
2828
vec3 diffuse = diff * vec3(2.0, 2.0, 2.0);

Game/Objects/GameCamera.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,15 @@
88
#include <Utils/SFMLInputsHelper.hpp>
99

1010
GameCamera::GameCamera(sf::RenderTarget &target)
11-
: Camera(target, {
12-
{0, 100, 0},
13-
{ 0, 0, 0 }
14-
}, 45.f / 180.0f * PI<float>, 0.1f, 2000.f)
11+
: Camera(
12+
target,
13+
{
14+
{ 0, 50, 0 },
15+
{ 0, 0, 0 }
16+
},
17+
45.f / 180.0f * PI<float>,
18+
0.1f,
19+
2000.f)
1520
{}
1621

1722
void GameCamera::Update(float dt)

README.md

Lines changed: 95 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,111 @@
1-
# Procedural terrain with opengl
1+
# Procedural Terrain with OpenGL
22

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.
44

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)
66

7-
```bash
8-
git submodule update --init --recursive
9-
```
7+
## Features
108

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.
1216

13-
_Windows_
14-
```bash
15-
.\vcpkg\bootstrap-vcpkg.bat
17+
## Showcase
18+
19+
### Terrain
20+
![Procedural Terrain](.github/images/procedural_terrain.png)
21+
22+
### User Interface
23+
![User Interface](.github/images/user_interface.png)
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
1651
```
1752

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
2159
```
2260

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+
```
2476

25-
Install dependencies :
77+
**Compile :**
2678

27-
_Windows_
2879
```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
3091
```
3192

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
3399
```bash
34-
./vcpkg/vcpkg install --triplet x64-linux
100+
# Unix like
101+
./out/Debug/Game/Game
102+
# Windows
103+
.\out\Debug\Game\Game.exe
35104
```
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

Comments
 (0)