# nem0/lumixengine architecture

> Architecture diagram of the GitHub repository nem0/lumixengine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nem0/lumixengine
- Repository: https://github.com/nem0/lumixengine

## Overview

#### Purpose and entry points
Lumix Engine is a native C++ 3D game engine plus the Lumix Studio editor. Application startup is `src/app/main.cpp`; platform-specific Studio launchers are `src/studio/win/main.cpp` and `src/studio/linux/main.cpp`. Studio configuration and built-in assets begin under `data/studio_default.ini` and `data/`.

#### Engine kernel and modular runtime
The engine centers on a world/entity-component model, resource loading, reflection, and dynamically composed plugins/modules. `Engine` coordinates systems while `World` owns scene state; plugin/module boundaries allow renderer, physics, animation, Lua, navigation, audio, and UI features to attach to the core runtime.
- `src/engine/engine.cpp`
- `src/engine/world.cpp`
- `src/engine/plugin.cpp`

#### Core platform services
A shared core layer provides allocation, threading/fibers, job scheduling, logging, streams, paths, profiling, and OS abstractions. Platform-specific implementations are split between Windows and Linux; higher engine modules should depend on these abstractions rather than directly on OS facilities.
- `src/core/job_system.cpp`
- `src/core/win/os.cpp`
- `src/core/linux/os.cpp`

#### Editor and asset pipeline
Lumix Studio is an ImGui-based authoring environment around the runtime. It edits worlds/prefabs, exposes property/reflection-driven controls, watches project files, and compiles/imports assets. The key boundary is source project content versus runtime/editor asset representations; importers turn formats such as FBX into engine resources.
- `src/editor/studio_app.cpp`
- `src/editor/asset_compiler.cpp`
- `src/renderer/editor/fbx_importer.cpp`

#### Rendering and GPU pipeline
The renderer consumes world visibility/culling data and resource-backed models, materials, textures, terrain, particles, and shaders to issue GPU work. GPU abstraction currently includes a DirectX 12 backend; shader programs and post-processing effects are data-driven HLSL assets. Editor scene/game views use the same renderer through editor-facing integration.
- `src/renderer/renderer.cpp`
- `src/renderer/gpu/gpu_dx12.cpp`
- `data/shaders/lighting.hlsl`

#### Simulation, gameplay, and UI modules
Runtime behavior is supplied by specialized modules: PhysX-backed physics, Recast/Detour navigation, animation controllers/graphs, platform audio devices, Luau scripts, and UI resources/systems. These systems operate on engine world entities and are surfaced to users through editor plugins and Lua APIs.
- `src/physics/physics_system.cpp`
- `src/navigation/navigation_system.cpp`
- `src/lua/lua_script_system.cpp`
- `src/ui/ui_system.cpp`

#### Content, dependencies, and delivery
`data/` contains engine defaults (shaders, materials, editor assets); `demo/` is a runnable/sample project with serialized worlds (`.unv`), scripts, UI, models, navzones, and probes. Major vendored dependencies include PhysX, Luau, Recast/Detour, Dear ImGui, FreeType, meshoptimizer, and OpenFBX. Build/project generation uses Genie, with GitHub Actions driving build, test, and deployment workflows.
- `demo/maps/demo/demo.unv`
- `external/physx/include/PxPhysics.h`
- `scripts/genie.lua`

Main entry points: [`src/engine/plugin.cpp`](https://github.com/nem0/lumixengine/blob/master/src/engine/plugin.cpp) (Plugin system), [`src/editor/studio_app.cpp`](https://github.com/nem0/lumixengine/blob/master/src/editor/studio_app.cpp) (Lumix Studio), [`src/engine/engine.cpp`](https://github.com/nem0/lumixengine/blob/master/src/engine/engine.cpp) (Engine), [`src/renderer/renderer.cpp`](https://github.com/nem0/lumixengine/blob/master/src/renderer/renderer.cpp) (Renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core runtime"]
  node_core_services["Core services<br/>platform abstraction<br/>[job_system.cpp]"]
  node_engine{{"Engine<br/>runtime coordinator<br/>[engine.cpp]"}}
  node_world["World<br/>ECS scene state<br/>[world.cpp]"]
  node_plugin_system["Plugin system<br/>module composition<br/>[plugin.cpp]"]
end

subgraph group_studio["Studio and assets"]
  node_studio_launcher["Studio launchers<br/>platform entry points"]
  node_studio["Lumix Studio<br/>ImGui editor<br/>[studio_app.cpp]"]
  node_asset_compiler["Asset compiler<br/>content pipeline<br/>[asset_compiler.cpp]"]
  node_fbx_importer["FBX importer<br/>asset importer<br/>[fbx_importer.cpp]"]
  node_engine_data[("Engine data<br/>default assets<br/>[studio_default.ini]")]
end

subgraph group_rendering["Rendering"]
  node_renderer{{"Renderer<br/>render module<br/>[renderer.cpp]"}}
  node_dx12_backend["DirectX 12 backend<br/>GPU backend<br/>[gpu_dx12.cpp]"]
  node_shader_assets["Shader programs<br/>HLSL assets<br/>[lighting.hlsl]"]
end

subgraph group_modules["Feature modules"]
  node_physics["Physics<br/>PhysX module<br/>[physics_system.cpp]"]
  node_navigation["Navigation<br/>Recast/Detour module"]
  node_lua["Lua scripting<br/>Luau module"]
  node_ui["UI system<br/>UI module<br/>[ui_system.cpp]"]
  node_physx["PhysX<br/>vendored dependency<br/>[PxPhysics.h]"]
end

subgraph group_delivery["Build and delivery"]
  node_demo_project["Demo project<br/>sample content<br/>[demo.unv]"]
  node_genie["Genie build generation<br/>build tooling<br/>[genie.lua]"]
end

node_app["Application startup<br/>native entry point<br/>[main.cpp]"]

node_app -->|"starts"| node_engine
node_studio_launcher -->|"launches"| node_studio
node_studio -->|"hosts runtime"| node_engine
node_engine -->|"uses"| node_core_services
node_engine -->|"coordinates"| node_world
node_engine -->|"loads modules through"| node_plugin_system
node_plugin_system -->|"attaches"| node_renderer
node_plugin_system -->|"attaches"| node_physics
node_plugin_system -->|"attaches"| node_navigation
node_plugin_system -->|"attaches"| node_lua
node_plugin_system -->|"attaches"| node_ui
node_physics -->|"uses"| node_physx
node_renderer -->|"renders"| node_world
node_renderer -->|"submits GPU work"| node_dx12_backend
node_renderer -->|"loads"| node_shader_assets
node_studio -->|"drives scene views"| node_renderer
node_studio -->|"invokes"| node_asset_compiler
node_asset_compiler -->|"uses"| node_fbx_importer
node_asset_compiler -->|"produces runtime assets from"| node_engine_data
node_studio -->|"authors and opens"| node_demo_project
node_demo_project -->|"provides source content"| node_asset_compiler
node_genie -.->|"generates build for"| node_app
node_genie -.->|"generates build for"| node_studio

click node_app "https://github.com/nem0/lumixengine/blob/master/src/app/main.cpp"
click node_core_services "https://github.com/nem0/lumixengine/blob/master/src/core/job_system.cpp"
click node_engine "https://github.com/nem0/lumixengine/blob/master/src/engine/engine.cpp"
click node_world "https://github.com/nem0/lumixengine/blob/master/src/engine/world.cpp"
click node_plugin_system "https://github.com/nem0/lumixengine/blob/master/src/engine/plugin.cpp"
click node_studio "https://github.com/nem0/lumixengine/blob/master/src/editor/studio_app.cpp"
click node_asset_compiler "https://github.com/nem0/lumixengine/blob/master/src/editor/asset_compiler.cpp"
click node_fbx_importer "https://github.com/nem0/lumixengine/blob/master/src/renderer/editor/fbx_importer.cpp"
click node_engine_data "https://github.com/nem0/lumixengine/blob/master/data/studio_default.ini"
click node_demo_project "https://github.com/nem0/lumixengine/blob/master/demo/maps/demo/demo.unv"
click node_renderer "https://github.com/nem0/lumixengine/blob/master/src/renderer/renderer.cpp"
click node_dx12_backend "https://github.com/nem0/lumixengine/blob/master/src/renderer/gpu/gpu_dx12.cpp"
click node_shader_assets "https://github.com/nem0/lumixengine/blob/master/data/shaders/lighting.hlsl"
click node_physics "https://github.com/nem0/lumixengine/blob/master/src/physics/physics_system.cpp"
click node_navigation "https://github.com/nem0/lumixengine/blob/master/src/navigation/navigation_system.cpp"
click node_lua "https://github.com/nem0/lumixengine/blob/master/src/lua/lua_script_system.cpp"
click node_ui "https://github.com/nem0/lumixengine/blob/master/src/ui/ui_system.cpp"
click node_physx "https://github.com/nem0/lumixengine/blob/master/external/physx/include/PxPhysics.h"
click node_genie "https://github.com/nem0/lumixengine/blob/master/scripts/genie.lua"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_core_services,node_engine,node_world,node_plugin_system toneBlue
class node_studio_launcher,node_studio,node_asset_compiler,node_fbx_importer,node_engine_data toneAmber
class node_renderer,node_dx12_backend,node_shader_assets toneMint
class node_physics,node_navigation,node_lua,node_ui,node_physx toneRose
class node_demo_project,node_genie toneIndigo
class node_app toneNeutral
```

## Components

### Core runtime

Shared engine services and ECS world runtime.

- [Core services](https://github.com/nem0/lumixengine/blob/master/src/core/job_system.cpp): platform abstraction · Jobs, fibers, allocation, logging, streams, and OS services. · `src/core/job_system.cpp`
- [Engine](https://github.com/nem0/lumixengine/blob/master/src/engine/engine.cpp): runtime coordinator · Composes modules and coordinates runtime systems. · `src/engine/engine.cpp`
- [World](https://github.com/nem0/lumixengine/blob/master/src/engine/world.cpp): ECS scene state · Owns entities and scene state. · `src/engine/world.cpp`
- [Plugin system](https://github.com/nem0/lumixengine/blob/master/src/engine/plugin.cpp): module composition · Attaches feature modules to the engine. · `src/engine/plugin.cpp`

### Studio and assets

Authoring, import, and project-content boundary.

- **Studio launchers**: platform entry points · Windows and Linux launch Lumix Studio.
- [Lumix Studio](https://github.com/nem0/lumixengine/blob/master/src/editor/studio_app.cpp): ImGui editor · Edits worlds and exposes reflection-driven tools. · `src/editor/studio_app.cpp`
- [Asset compiler](https://github.com/nem0/lumixengine/blob/master/src/editor/asset_compiler.cpp): content pipeline · Converts source project content into engine assets. · `src/editor/asset_compiler.cpp`
- [FBX importer](https://github.com/nem0/lumixengine/blob/master/src/renderer/editor/fbx_importer.cpp): asset importer · `src/renderer/editor/fbx_importer.cpp`
- [Engine data](https://github.com/nem0/lumixengine/blob/master/data/studio_default.ini): default assets · Built-in editor assets, materials, and shaders. · `data/studio_default.ini`

### Rendering

World rendering and GPU execution.

- [Renderer](https://github.com/nem0/lumixengine/blob/master/src/renderer/renderer.cpp): render module · Consumes world visibility and resources to issue GPU work. · `src/renderer/renderer.cpp`
- [DirectX 12 backend](https://github.com/nem0/lumixengine/blob/master/src/renderer/gpu/gpu_dx12.cpp): GPU backend · `src/renderer/gpu/gpu_dx12.cpp`
- [Shader programs](https://github.com/nem0/lumixengine/blob/master/data/shaders/lighting.hlsl): HLSL assets · Data-driven lighting and post-processing programs. · `data/shaders/lighting.hlsl`

### Feature modules

Runtime systems attached through engine plugins.

- [Physics](https://github.com/nem0/lumixengine/blob/master/src/physics/physics_system.cpp): PhysX module · `src/physics/physics_system.cpp`
- [Navigation](https://github.com/nem0/lumixengine/blob/master/src/navigation/navigation_system.cpp): Recast/Detour module · `src/navigation/navigation_system.cpp`
- [Lua scripting](https://github.com/nem0/lumixengine/blob/master/src/lua/lua_script_system.cpp): Luau module · `src/lua/lua_script_system.cpp`
- [UI system](https://github.com/nem0/lumixengine/blob/master/src/ui/ui_system.cpp): UI module · `src/ui/ui_system.cpp`
- [PhysX](https://github.com/nem0/lumixengine/blob/master/external/physx/include/PxPhysics.h): vendored dependency · `external/physx/include/PxPhysics.h`

### Build and delivery

Project generation and shipped sample content.

- [Demo project](https://github.com/nem0/lumixengine/blob/master/demo/maps/demo/demo.unv): sample content · Runnable serialized worlds and project assets. · `demo/maps/demo/demo.unv`
- [Genie build generation](https://github.com/nem0/lumixengine/blob/master/scripts/genie.lua): build tooling · `scripts/genie.lua`

### Other components

- [Application startup](https://github.com/nem0/lumixengine/blob/master/src/app/main.cpp): native entry point · `src/app/main.cpp`

## Connections

- Application startup → Engine: starts
- Studio launchers → Lumix Studio: launches
- Lumix Studio → Engine: hosts runtime
- Engine → Core services: uses
- Engine → World: coordinates
- Engine → Plugin system: loads modules through
- Plugin system → Renderer: attaches
- Plugin system → Physics: attaches
- Plugin system → Navigation: attaches
- Plugin system → Lua scripting: attaches
- Plugin system → UI system: attaches
- Physics → PhysX: uses
- Renderer → World: renders
- Renderer → DirectX 12 backend: submits GPU work
- Renderer → Shader programs: loads
- Lumix Studio → Renderer: drives scene views
- Lumix Studio → Asset compiler: invokes
- Asset compiler → FBX importer: uses
- Asset compiler → Engine data: produces runtime assets from
- Lumix Studio → Demo project: authors and opens
- Demo project → Asset compiler: provides source content
- Genie build generation → Application startup: generates build for
- Genie build generation → Lumix Studio: generates build for
