This project is a Procedural Terrain Generator implemented in C++ and OpenGL. It showcases various advanced rendering techniques, including Perlin noise-based terrain generation, normal mapping, water rendering, and a skybox for realistic visuals. The project is ideal for those interested in learning about computer graphics, procedural content generation, and modern OpenGL practices.
Click on the image below to check out the demo video -
- Procedural Terrain Generation: Uses Perlin noise to generate realistic terrain with adjustable parameters like octaves, persistence, and frequency.
- Normal Mapping: Adds fine details to the terrain surface without increasing the mesh complexity. [In Progress]
- Water Rendering: Implements a reflective and refractive water surface with wave animations. [In Progress]
- Skybox: Surrounds the scene with a skybox for a fully immersive environment. [In Progress]
- Basic Lighting: Incorporates Phong lighting for ambient, diffuse, and specular reflections.
- Camera Control: An Arcball camera system allows for smooth panning, rotation, and zoom around the terrain.
├── src/
├── main.cpp # Main entry point for the application
├── PerlinNoise.cpp # Perlin noise implementation
├── ArcballCamera.cpp # Camera control implementation
└── shaders/ # Directory containing vertex and fragment shaders
├── textures/ # Directory for textures used in the project
├── CMakeLists.txt # CMake build script
└── README.md # Project documentation
- C++ Compiler: Ensure you have a modern C++ compiler installed (GCC, Clang, or MSVC).
- CMake: Required to build the project.
- GLFW: For window management and OpenGL context creation.
- GLAD: For loading OpenGL functions.
- stb_image: For loading image files (e.g., textures).
- Clone the repository
git clone https://github.com/pkunjam/procedural-terrain-generator.git
cd procedural-terrain-generator
- Build the project
mkdir build
cd build
cmake ..
make
- Run the Executable
./ProceduralTerrain
Camera Controls:
- Left Mouse Button: Rotate the camera around the terrain.
- Right Mouse Button: Pan the camera.
- Scroll Wheel: Zoom in and out.
Terrain Parameters: Adjust the terrain parameters (octaves, persistence, etc.) directly in the main.cpp file to see how different settings affect the terrain generation.
Contributions are what makes the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the GNU General Public License v3.0 License. See LICENSE.txt
for more details.