A basic graphics engine written with C++
using OpenGL API
.
I use Qt 6
for window and event management.
All 3D math operation is done by Qt 6
's math module.
The engine has following features:
- Supports loading several 3D model formats thanks to
assimp
library - Parent - child node hiearchy
- Transformation of individual meshes of models
- Particle generator
- Terrain, sky, sun, volumetric clouds, water, haze
- Dummy and free cameras
- Directional, point and spot lights
- Easy shader loading and linking
- Framebuffer generation with several attachments and different formats
I will add following features:
- Editor
- WGS84 support
- Terrain generation using DTED
- Albedo generation using satellite images
- Post processing effects
- Install
CMake 3.25.1
. - Install
Visual Studio 2019 and MSVC C++ Compiler
. - Install
Qt 6.4.1 MSVC2019 64bit
kit. - Clone the repo
git clone https://github.com/berkbavas/CanavarGraphicsEngine.git
. - Create a folder
mkdir Build
. - Enter the folder
cd Build
. - Run CMake
cmake ..
. - Open
Canavar.sln
withVisual Studio 2019
. - Build & Run with
Release
config.
Creating a model can be done with one liner:
Node *aircraft = NodeManager::Instance()->CreateModel("f16c");
NodeManager
class automatically register this model to render list. You do not have to do anything else.
Ownership belongs to NodeManager
. You can remove any node with one liner again.
NodeManager::Instance()->RemoveNode(aircraft);
It is NodeManager
's responsibility to the clean up the resources.
Attaching a camera to a node is also easy:
Camera *camera = NodeManager::Instance()->Create(Node::NodeType::DummyCamera);
aircraft->AddChild(camera);
You can set local position of camera
:
camera->SetPosition(QVector3D(0, 0, 10));
Now you can set camera
as the active camera:
CameraManager::Instance()->SetActiveCamera(camera);
I thank Federico Vaccaro for his amazing shaders and Joey de Vries for his OpenGL tutorials.