# nicholasgallina/nemesis-engine architecture

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

- Interactive diagram: https://gitdiagram.com/nicholasgallina/nemesis-engine
- Repository: https://github.com/nicholasgallina/nemesis-engine

## Overview

Nemesis is a Vulkan-based real-time 3D rendering engine. Its user-facing workflow is to launch the application, interact with a camera and scene objects, and render those objects and point lights to a window. The architecture separates application orchestration, Vulkan/window infrastructure, scene and model data, and rendering systems. The README documents lighting, transparency, keyboard camera control, and tinyobjloader model loading; source excerpts are incomplete, so edges for documented features are included only where their runtime connections are supported or explicitly described.

Main entry points: [`src/first_app.cpp`](https://github.com/nicholasgallina/nemesis-engine/blob/master/src/first_app.cpp) (Application Loop), [`src/nre_pipeline.cpp`](https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_pipeline.cpp) (Graphics Pipeline), [`src/nre_model.cpp`](https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_model.cpp) (Model Loading), [`src/systems/simple_render_system.cpp`](https://github.com/nicholasgallina/nemesis-engine/blob/master/src/systems/simple_render_system.cpp) (Scene Rendering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_main["Program Entry<br/>[main.cpp]"]
  node_application["Application Loop<br/>[first_app.cpp]"]
end

subgraph group_platform["Vulkan Platform"]
  node_window["Window<br/>[nre_window.cpp]"]
  node_device["Vulkan Device<br/>[nre_device.cpp]"]
  node_swapchain["Swap Chain<br/>[nre_swap_chain.cpp]"]
  node_renderer["Frame Renderer<br/>[nre_renderer.cpp]"]
  node_buffer["GPU Buffers<br/>[nre_buffer.cpp]"]
  node_descriptors["Descriptors"]
end

subgraph group_scene["Scene Data"]
  node_controller["Keyboard Controller"]
  node_camera["Camera<br/>[nre_camera.cpp]"]
  node_objects["Game Objects"]
  node_model["Model Loading<br/>[nre_model.cpp]"]
end

subgraph group_render["Rendering"]
  node_frameinfo["Frame Context<br/>[nre_frame_info.hpp]"]
  node_pipeline["Graphics Pipeline<br/>[nre_pipeline.cpp]"]
  node_simple["Scene Rendering"]
  node_lights["Point Lighting"]
  node_shaders["Shader Programs"]
end

node_user(("User"))
node_tinyobj["tinyobjloader<br/>[tiny_obj_loader.h]"]

node_user -->|"interacts with"| node_application
node_main -->|"starts"| node_application
node_application -->|"creates"| node_window
node_application -->|"uses"| node_device
node_application -->|"drives frames"| node_renderer
node_application -->|"updates controls"| node_controller
node_application -->|"updates view"| node_camera
node_application -->|"maintains scene"| node_objects
node_application -->|"configures"| node_descriptors
node_application -->|"uploads frame data"| node_buffer
node_device -->|"creates surface"| node_window
node_renderer -->|"uses"| node_swapchain
node_application -->|"invokes"| node_simple
node_application -->|"invokes"| node_lights
node_simple -->|"reads context"| node_frameinfo
node_lights -->|"reads context"| node_frameinfo
node_simple -->|"binds pipeline"| node_pipeline
node_lights -->|"binds pipeline"| node_pipeline
node_objects -->|"holds model"| node_model
node_model -->|"uses buffers"| node_buffer
node_model -.->|"loads mesh data"| node_tinyobj
node_pipeline -->|"loads bytecode"| node_shaders
node_pipeline -->|"creates Vulkan pipeline"| node_device
node_controller -->|"moves object"| node_objects

click node_main "https://github.com/nicholasgallina/nemesis-engine/blob/master/src/main.cpp"
click node_application "https://github.com/nicholasgallina/nemesis-engine/blob/master/src/first_app.cpp"
click node_window "https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_window.cpp"
click node_device "https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_device.cpp"
click node_swapchain "https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_swap_chain.cpp"
click node_renderer "https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_renderer.cpp"
click node_buffer "https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_buffer.cpp"
click node_descriptors "https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_descriptors.cpp"
click node_controller "https://github.com/nicholasgallina/nemesis-engine/blob/master/src/keyboard_movement_controller.cpp"
click node_camera "https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_camera.cpp"
click node_objects "https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_game_object.cpp"
click node_model "https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_model.cpp"
click node_tinyobj "https://github.com/nicholasgallina/nemesis-engine/blob/master/external/tinyobjloader/tiny_obj_loader.h"
click node_frameinfo "https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_frame_info.hpp"
click node_pipeline "https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_pipeline.cpp"
click node_simple "https://github.com/nicholasgallina/nemesis-engine/blob/master/src/systems/simple_render_system.cpp"
click node_lights "https://github.com/nicholasgallina/nemesis-engine/blob/master/src/systems/point_light_system.cpp"
click node_shaders "https://github.com/nicholasgallina/nemesis-engine/tree/master/shaders"

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_main,node_application,node_user toneBlue
class node_window,node_device,node_swapchain,node_renderer,node_buffer,node_descriptors toneAmber
class node_controller,node_camera,node_objects,node_model toneMint
class node_frameinfo,node_pipeline,node_simple,node_lights,node_shaders toneRose
class node_tinyobj toneTeal
```

## Components

### Application

- [Program Entry](https://github.com/nicholasgallina/nemesis-engine/blob/master/src/main.cpp): `src/main.cpp`
- [Application Loop](https://github.com/nicholasgallina/nemesis-engine/blob/master/src/first_app.cpp): `src/first_app.cpp`

### Vulkan Platform

- [Window](https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_window.cpp): `src/nre_window.cpp`
- [Vulkan Device](https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_device.cpp): `src/nre_device.cpp`
- [Swap Chain](https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_swap_chain.cpp): `src/nre_swap_chain.cpp`
- [Frame Renderer](https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_renderer.cpp): `src/nre_renderer.cpp`
- [GPU Buffers](https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_buffer.cpp): `src/nre_buffer.cpp`
- [Descriptors](https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_descriptors.cpp): `src/nre_descriptors.cpp`

### Scene Data

- [Keyboard Controller](https://github.com/nicholasgallina/nemesis-engine/blob/master/src/keyboard_movement_controller.cpp): `src/keyboard_movement_controller.cpp`
- [Camera](https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_camera.cpp): `src/nre_camera.cpp`
- [Game Objects](https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_game_object.cpp): `src/nre_game_object.cpp`
- [Model Loading](https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_model.cpp): `src/nre_model.cpp`

### Rendering

- [Frame Context](https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_frame_info.hpp): `src/nre_frame_info.hpp`
- [Graphics Pipeline](https://github.com/nicholasgallina/nemesis-engine/blob/master/src/nre_pipeline.cpp): `src/nre_pipeline.cpp`
- [Scene Rendering](https://github.com/nicholasgallina/nemesis-engine/blob/master/src/systems/simple_render_system.cpp): `src/systems/simple_render_system.cpp`
- [Point Lighting](https://github.com/nicholasgallina/nemesis-engine/blob/master/src/systems/point_light_system.cpp): `src/systems/point_light_system.cpp`
- [Shader Programs](https://github.com/nicholasgallina/nemesis-engine/tree/master/shaders): `shaders`

### Other components

- **User**
- [tinyobjloader](https://github.com/nicholasgallina/nemesis-engine/blob/master/external/tinyobjloader/tiny_obj_loader.h): `external/tinyobjloader/tiny_obj_loader.h`

## Connections

- User → Application Loop: interacts with (evidence: `README.md`)
- Program Entry → Application Loop: starts (evidence: `src/main.cpp`)
- Application Loop → Window: creates (evidence: `src/first_app.cpp`)
- Application Loop → Vulkan Device: uses (evidence: `src/first_app.cpp`)
- Application Loop → Frame Renderer: drives frames (evidence: `src/first_app.cpp`)
- Application Loop → Keyboard Controller: updates controls (evidence: `src/first_app.cpp`)
- Application Loop → Camera: updates view (evidence: `src/first_app.cpp`)
- Application Loop → Game Objects: maintains scene (evidence: `src/first_app.cpp`)
- Application Loop → Descriptors: configures (evidence: `src/first_app.cpp`)
- Application Loop → GPU Buffers: uploads frame data (evidence: `src/first_app.cpp`)
- Vulkan Device → Window: creates surface (evidence: `src/nre_device.cpp`)
- Frame Renderer → Swap Chain: uses
- Application Loop → Scene Rendering: invokes (evidence: `src/first_app.cpp`)
- Application Loop → Point Lighting: invokes (evidence: `src/first_app.cpp`)
- Scene Rendering → Frame Context: reads context
- Point Lighting → Frame Context: reads context
- Scene Rendering → Graphics Pipeline: binds pipeline
- Point Lighting → Graphics Pipeline: binds pipeline
- Game Objects → Model Loading: holds model
- Model Loading → GPU Buffers: uses buffers
- Model Loading → tinyobjloader: loads mesh data (evidence: `README.md`)
- Graphics Pipeline → Shader Programs: loads bytecode (evidence: `src/nre_pipeline.cpp`)
- Graphics Pipeline → Vulkan Device: creates Vulkan pipeline (evidence: `src/nre_pipeline.cpp`)
- Keyboard Controller → Game Objects: moves object
