Canavar Graphics Engine is a basic graphics engine written in C++ using the OpenGL API and Qt 6. It leverages Qt 6 for window and event management, and utilizes Qt's math module for all 3D math operations. The engine is designed to be modular and extensible, supporting a variety of modern rendering features and tools for 3D graphics applications.
- Supports loading GLTF 3D model format (powered by assimp)
- Parent-child node hierarchy
- Procedural terrain generation
- Sky with atmospheric scattering
- Haze effects
- Point lights
- Directional lights
- Spot lights
- Free camera and persecutor camera modes
- Transformation of individual meshes within models
- Lightning Strike Generator
- Nozzle Effect
- Shadow Mapping
- Point Shadows
- Particle generator
- Volumetric clouds
- Water rendering
- Vertex Painting
- Editor with ImGui integration
- Physically Based Rendering (PBR)
- WGS84 ellipsoid support
- Terrain generation using DTED and satellite images
- Post processing effects
City.mp4
Simulator.mp4
MultipleViews.mp4
-
Install CMake 3.25.1 or newer.
-
Install Visual Studio 2022 and the MSVC 2022 C++ Compiler.
-
Install Qt 6.x.y MSVC2022 64bit kit.
-
Set the environment variable
Qt6_DIR
to the path of your Qt installation (e.g.,C:/Qt/6.x.y/msvc2022_64/lib/cmake/Qt6
). -
Clone the repository:
git clone https://github.com/berkbavas/CanavarGraphicsEngine.git
-
Create a build directory:
mkdir Build
-
Navigate into the build directory:
cd Build
-
Run CMake to configure the project:
cmake ..
-
Open the generated solution file (
Canavar.sln
) with Visual Studio 2022. -
Edit
MODELS_FOLDER
variable inSource/Canavar/Engine/Core/Constants.h
to point to your models directory. Currently, I support only the GLTF format. -
Set Editor as the startup project.
-
Build and run the project using the Release configuration.
The Engine module is the core of the Canavar Graphics Engine, providing all essential systems for 3D rendering, scene management, and extensibility. It is written in C++ and leverages Qt 6 for windowing, math, and event handling, and OpenGL 4.5 for graphics.
Source/Canavar/Engine/Core/
— Core engine classes (window, rendering context, controller)Source/Canavar/Engine/Manager/
— Managers for rendering, nodes, shaders, lights, etc.Source/Canavar/Engine/Node/
— Scene nodes (objects, lights, cameras, effects, terrain, etc.)Source/Canavar/Engine/Util/
— Utilities (logging, math, ImGui integration, etc.)Resources/Shaders/
— GLSL shaders used by the engine
To use the Engine module in your application:
- Create a
RenderingContext
(e.g.,Window
orWidget
). - Instantiate a
Controller
with the rendering context. - Use the managers (NodeManager, RenderingManager, etc.) to set up your scene.
- Implement your own nodes or extend existing ones for custom behavior.
Example:
#include <Canavar/Engine/Core/Window.h>
#include <Canavar/Engine/Core/Controller.h>
#include <Canavar/Engine/Manager/NodeManager.h>
void MyClass::Run()
{
// Create a rendering context
mWindow = new Canavar::Engine::Window(this);
// Initialize the controller with rendering context
mController = new Canavar::Engine::Controller(mWindow, true, this);
// Setup connections
connect(mController, &Canavar::Engine::Controller::Initialized, this, &MyClass::Initialize);
connect(mController, &Canavar::Engine::Controller::Updated, this, &MyClass::Update);
connect(mController, &Canavar::Engine::Controller::PostRendered, this, &MyClass::PostRender);
mWindow->showMaximized();
}
void MyClass::Initialize()
{
mWindow->GetNodeManager()->ImportNodes("/path/to/your/scene.json");
}
void MyClass::Update(float ifps)
{
// Update code here
}
void MyClass::PostRender(float ifps)
{
// Post-render code here
}
- Joey de Vries for OpenGL tutorials
- Contributors to Qt, assimp, freetype, JSBSim
This project is licensed under the MIT License. See the LICENSE file for details.