Skip to content

Furry-Monster/Realm

Repository files navigation

RealmEngine

English | 中文

A modern OpenGL game engine with PBR rendering, a visual editor, and an ECS architecture.

editor

pbr + npr

pbr + npr

debug

Features

  • PBR Rendering — Cook-Torrance BRDF, Metallic/Roughness workflow, multi-pass pipeline (Shadow, GTAO, Bloom, SSS, SSR, Post-processing)
  • Image-Based Lighting — Diffuse irradiance, specular prefiltering, BRDF LUT
  • Visual Editor — ImGui-based scene editor with viewport, hierarchy, properties, asset browser, profiler, undo/redo, hotkeys;
  • ECS Architecture — EnTT-powered with Transform, Renderable, Camera, Lighting, Hierarchy, AudioSource, AudioListener components
  • Audio System — miniaudio integration; spatial audio; listener management
  • Scene Management — Scene graph, JSON serialization, resource caching (glTF / FBX / OBJ / PLY / STL)
  • RHI Abstraction — OpenGL backend, architecture ready for Vulkan / D3D12

Rendering

The engine supports Forward and Deferred pipelines. Both use Cook-Torrance PBR with metallic/roughness workflow.

Feature Description
Shadows Directional: 4-cascade CSM with PCF/PCSS; Point: cubemap depth (up to 4); Spot: 2D depth (up to 4). Shadow preview mode for debugging.
IBL Diffuse irradiance cubemap, prefiltered specular env map, BRDF LUT; HDRI-based skybox
GTAO Screen-space ambient occlusion with multi-direction ray march and bilateral blur
SSS Subsurface scattering (BSSRDF-inspired wrapped diffuse) for skin/fabric; Forward pipeline via material subsurface option
Bloom Brightness threshold extract, 6-level mip chain, separable Gaussian blur
SSR Screen-space reflection (Deferred only); Hi-Z accelerated ray march; Fresnel and roughness modulation; composited in post-process
Post-process AO blend, bloom add, Reinhard tonemapping, gamma correction
Display modes Lit, Albedo, Normals, Metallic, Roughness, Material AO, Emissive, AO, Depth, SSR, Shadow preview

Deferred pipeline adds G-Buffer (4 RTs + depth), Hi-Z, clustered light culling (compute) 、SSR. Forward pipeline uses direct PBR with full light iteration. Pipeline mode is configurable in Project Settings.

Requirements

  • OS: Windows / Linux / macOS
  • Compiler: C++17 (MSVC 2017+, GCC 7+, Clang 5+)
  • CMake: 3.20+  |  OpenGL: 3.3+  |  Python: 3.6+ (build scripts)

Quick Start

git clone --recursive https://github.com/Furry-Monster/RealmEngine.git
cd RealmEngine

# Build & run (Python script)
python scripts/build.py -t Release -j 8 -r

# Or manual CMake
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --parallel

After build, run bin/RealmEditor (or bin/RealmEditor.exe on Windows).

Project Structure

RealmEngine/
├── engine/          # Core engine library (RHI, renderer, ECS, platform)
├── editor/          # Visual editor (panels, commands, bridge)
├── sandbox/         # Standalone sandbox player
├── shaders/         # GLSL shaders
├── assets/          # Models, textures, HDR environment maps
├── libs/            # Third-party dependencies (git submodules)
├── scripts/         # Build, format, lint, test scripts
└── CMakeLists.txt

Dependencies

All managed as git submodules in libs/:

GLFW | GLAD | GLM | Assimp | spdlog | ImGui | ImGuizmo | stb | EnTT | miniaudio | nlohmann/json

Build Options

python scripts/build.py --help

# Common usage
python scripts/build.py                    # Debug build
python scripts/build.py -t Release -j 8   # Release, 8 jobs
python scripts/build.py -c -r             # Clean, build, run
python scripts/build.py --no-editor       # Skip editor
python scripts/build.py --no-sandbox      # Skip sandbox
python scripts/build.py --tests           # Enable tests

# Code quality
python scripts/format.py                  # clang-format
python scripts/lint.py                    # clang-tidy

See scripts/GUIDE.md for full build documentation.

License

MIT License — see LICENSE.

Contributing

Issues and Pull Requests are welcome.