The project consists of an animated 3D scene created in C++ using OpenGL. It contains several interactive settings allowing users to change the feel and details of the presented scene, such as toggleable normal mapping and implementation of two different lighting models.
The project has been tested on a Windows 10 device using C++20 and compiled using CMake.
Ensure you have the following dependencies installed:
- CMake
- A C++20-compatible compiler
- OpenGL development libraries
- GLFW3
- Assimp
- Zlib
Start by cloning the repository:
git clone https://github.com/kubapoke/renderer-3D
cd renderer-3D-
Create a build directory:
mkdir build cd build -
Generate build files with CMake:
cmake ..
This ensures that the project is compiled using C++20.
-
Compile the project:
cmake --build .
Once the build process is complete, you can run the application by executing:
./Renderer3DAfter launching the application, you will be presented with a 3D scene, which consists of several objects:
- A plane representing the ground.
- A big, golden sphere in the middle of the scene.
- A cube, close to the sphere.
- A spaceship orbiting the cube whilst slowly moving up and down.
The scene is lit up by several lights:
- A directional light representing the sun.
- Two point lights, denoted by the white spheres.
- A spotlight on the spaceship.
Several elements of the scene are interactive, for a more concise look at the controls refer to the README.md file inside the project directory. This section will contain a more detailed look on what each of them does.
By default, you are put in a free camera mode. You control it by using
mouse movement to look around and WASD buttons to move, as well
as your mouse scroll to zoom in. There also 3 built-in fixed camera
modes that you can enter by pressing one of the following number buttons:
1- A stationary camera observing the scene.2- A stationary camera observing the spaceship.3- A camera fixed to the spaceship, following it from behind.
Whenever in a fixed camera mode you can press 0 to
return to the free camera mode.
Z/X buttons toggle the scene between day and night mode respectively,
by modifying the values of light produced by the directional light.
| Day | Night |
|---|---|
![]() |
![]() |
C/V buttons decrease/increase (gradually) the amount of fog present
respectively.
| Low fog level | High fog level |
|---|---|
![]() |
![]() |
B/N buttons swap the calculation of specular component of lighting
between the Blinn and Phong models.
| Blinn lighting model | Phong lighting model |
|---|---|
![]() |
![]() |
F/G buttons toggle normal mapping on/off respectively.
| Normal mapping on | Normal mapping off |
|---|---|
![]() |
![]() |
The arrow buttons (UP, DOWN, LEFT, RIGHT) change the relative
position of the spaceship's spotlight.
Whenever you wish to quit the application, press the ESC button.
All textures in the project are sourced from the Poly Haven website. The spaceship model used comes from Ilya Shevchuck on SketchFab.










