Skip to content

KleaSCM/Kanae

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kanae Engine

Kanae is a high-performance, universal game engine built on data-oriented principles. It features a fully decoupled 16-thread fiber job system, sparse-set ECS, and a physically based (PBR) rendering pipeline, designing for maximum cache locality and thread throughput on modern hardware.


Architecture

The engine uses a decoupled architecture where Physics (Fixed Update) and Rendering (Interpolated) run at different frequencies.

graph TD
    subgraph "Core Loop"
        Input[Input Polling] --> JobSystem
        JobSystem --> Update
        JobSystem --> Render
    end

    subgraph "Systems (ECS)"
        Update --> Script[Lua Scripting]
        Update --> Physics[Physics Solver]
        Update --> Audio[Audio Mixer]
        
        Physics -->|State| Transform[Sparse Set Storage]
    end

    subgraph "Rendering Pipeline"
        Render --> Cull[Frustum Culling]
        Cull --> Sort[State Sorting]
        Sort --> Batch[Batcher]
        Batch --> GPU[OpenGL 4.6 Backend]
    end

    subgraph "Hot Reload"
        Watch[File Watcher] -.->|Reload| Script
        Watch -.->|Recompile| GPU
    end
Loading

Key Features

Core Systems

  • Fiber Job System: N-thread work stealing scheduler for massive parallelism.
  • Data-Oriented ECS: Sparse set component storage ensuring O(1) access and optimal cache coherence.
  • Memory Management: Region-based compositors with linear allocators to eliminate GC spikes.

Rendering

  • Modern OpenGL 4.6: Direct State Access (DSA) and Multi-Draw Indirect (MDI).
  • PBR Pipeline: Metallic/Roughness workflow with Image Based Lighting (IBL).
  • Post-Processing: Bloom, Tone Mapping (ACES), and Gamma Correction.

Asset Pipeline

  • Hot-Reloading: Real-time reloading of Lua scripts, Shaders, and Textures without restarting.
  • Virtual File System: Protocol abstraction (core://, game://) for transparent asset loading.
  • Reflection System: Runtime introspection of C++ types for serialization and editor tooling.

Getting Started

Prerequisites

  • C++17 Compiler (GCC 9+, Clang 10+, MSVC 2019+)
  • CMake 3.20+
  • OpenGL 4.6 capable GPU

Build Instructions

# Clone the repository
git clone https://github.com/KleaSCM/Kanae.git
cd Kanae

# Configure and build
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .

Usage

# Run the engine editor/sandbox
./bin/Kanae

Project Structure

Kanae/
├── src/
│   ├── Core/           # JobSystem, Memory, Logging
│   ├── Systems/        # ECS, Physics, Audio
│   ├── Renderer/       # OpenGL Backend, Shaders
│   ├── Scripting/      # Lua bindings (sol2)
│   ├── Platform/       # Windowing (GLFW), Input
│   └── Scene/          # Serialization, Entity management
├── include/            # Public headers
├── assets/             # Shaders, Textures, Scripts
└── external/           # Vendor libraries (glad, glm, stb)

License

MIT License — see LICENSE file for details.

Contact

For questions and support: KleaSCM@gmail.com

About

A modular game engine written in C++23 featuring OpenGL renderer, Lua scripting via sol2, custom physics with broadphase collision detection, ECS-style systems architecture, asset pipeline with texture/mesh/font importers, audio via miniaudio, and a virtual filesystem. Includes MSDF font rendering,scene management, and job-based threading.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors