# thattanishqtak/3d-renderer architecture

> Architecture diagram of the GitHub repository thattanishqtak/3d-renderer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/thattanishqtak/3d-renderer
- Repository: https://github.com/thattanishqtak/3d-renderer

## Overview

##### Project type and purpose
- This is a native C++ 3D‐renderer engine (“Trident”) plus an editor/sample application (“Trident-Forge”).
- Trident implements the core engine subsystems (windowing, event dispatch, ECS, rendering, resource loading, UI, AI integration). Trident-Forge sits on top as an application layer that loads assets and exercises the engine.

##### File structure
- Top-level:
- CMakeLists.txt / cmake/ – build configuration, external dependency management
- Scripts/ – helper scripts for building on Windows
- Trident/ – the engine library: organized into src/{AI, Application, Core, ECS, Events, Geometry, Layer, Loader, Renderer, UI, Window, vendor}
- Trident-Forge/ – editor application: Assets (models, shaders, fonts), CMakeLists.txt, src/{EntryPoint, ApplicationLayer, Panels}
- Key patterns:
- Layered architecture: ApplicationLayer → Engine Core → Renderer / ECS / Loader / UI / Window
- ECS (Entity, Components, Systems) for scene management
- Renderer subsystem built around command buffers, pipelines, swapchains
- UI subsystem uses ImGui via an ImGuiLayer
- Loader subsystem uses Assimp and stb for assets
- AI subsystem using ONNX Runtime

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Editor Layer
    subgraph "Trident-Forge Editor"
        direction TB
        EntryPoint["EntryPoint"]:::app
        AppLayer["ApplicationLayer"]:::app
        subgraph "Editor Panels"
            direction TB
            CB["ContentBrowserPanel"]:::ui
            Inspector["InspectorPanel"]:::ui
            SceneHierarchy["SceneHierarchyPanel"]:::ui
            Viewport["ViewportPanel"]:::ui
            Gizmo["GizmoState"]:::ui
        end
    end

    %% Engine Core Layer
    subgraph "Trident Engine Core"
        direction TB
        CoreApp["Application"]:::core
        WindowMgr["Window & Input Manager"]:::core
        EventDisp["Event Dispatcher"]:::core
        ECS["Entity-Component-System"]:::core
        Loader["Resource Loader"]:::loader
        Renderer["Renderer Subsystem"]:::renderer
        UILayer["UI Layer"]:::ui
        AIInt["AI Integration"]:::ai
    end

    %% Infrastructure and Platforms
    Disk["Asset Storage (Disk)"]:::storage
    GPUAPI["GPU API (Vulkan/OpenGL)"]:::gpu
    CMake["Build & Vendor Config"]:::infra

    %% Connections
    EntryPoint -->|starts| AppLayer
    AppLayer -->|calls Init/Update/Render| CoreApp
    CoreApp --> WindowMgr
    CoreApp --> EventDisp
    CoreApp --> ECS
    CoreApp --> Loader
    CoreApp --> Renderer
    CoreApp --> UILayer
    CoreApp --> AIInt

    WindowMgr -->|polls events| EventDisp
    EventDisp -->|dispatches events| UILayer
    EventDisp -->|dispatches events| ECS

    ECS -->|provides scene data| Renderer
    Loader -->|loads assets| ECS
    UILayer -->|renders overlay via| Renderer
    AIInt -->|outputs behavior| ECS

    Renderer -->|issues draw calls| GPUAPI
    Disk -->|reads assets| Loader

    CMake -.-> CoreApp
    CMake -.-> Loader
    CMake -.-> Renderer
    CMake -.-> UILayer
    CMake -.-> AIInt

    %% Click Events
    click EntryPoint "https://github.com/thattanishqtak/3d-renderer/blob/main/Trident-Forge/src/EntryPoint.cpp"
    click AppLayer "https://github.com/thattanishqtak/3d-renderer/blob/main/Trident-Forge/src/ApplicationLayer.cpp"
    click CB "https://github.com/thattanishqtak/3d-renderer/blob/main/Trident-Forge/src/Panels/ContentBrowserPanel.cpp"
    click Inspector "https://github.com/thattanishqtak/3d-renderer/blob/main/Trident-Forge/src/Panels/InspectorPanel.cpp"
    click SceneHierarchy "https://github.com/thattanishqtak/3d-renderer/blob/main/Trident-Forge/src/Panels/SceneHierarchyPanel.cpp"
    click Viewport "https://github.com/thattanishqtak/3d-renderer/blob/main/Trident-Forge/src/Panels/ViewportPanel.cpp"
    click Gizmo "https://github.com/thattanishqtak/3d-renderer/blob/main/Trident-Forge/src/Panels/GizmoState.h"
    click CoreApp "https://github.com/thattanishqtak/3d-renderer/blob/main/Trident/src/Application.cpp"
    click WindowMgr "https://github.com/thattanishqtak/3d-renderer/blob/main/Trident/src/Window/Window.cpp"
    click EventDisp "https://github.com/thattanishqtak/3d-renderer/blob/main/Trident/src/Events/Events.h"
    click ECS "https://github.com/thattanishqtak/3d-renderer/blob/main/Trident/src/ECS/ECS.h"
    click Loader "https://github.com/thattanishqtak/3d-renderer/blob/main/Trident/src/Loader/ModelLoader.cpp"
    click Renderer "https://github.com/thattanishqtak/3d-renderer/blob/main/Trident/src/Renderer/Renderer.cpp"
    click UILayer "https://github.com/thattanishqtak/3d-renderer/blob/main/Trident/src/UI/ImGuiLayer.cpp"
    click AIInt "https://github.com/thattanishqtak/3d-renderer/blob/main/Trident/src/AI/ONNXRuntime.cpp"
    click CMake "https://github.com/thattanishqtak/3d-renderer/blob/main/CMakeLists.txt"

    %% Styles
    classDef app fill:#fdae61,stroke:#e6550d,color:#000;
    classDef core fill:#a6d96a,stroke:#4d9221,color:#000;
    classDef ui fill:#2b83ba,stroke:#081d58,color:#fff;
    classDef loader fill:#ffffbf,stroke:#bdb76b,color:#000;
    classDef renderer fill:#9e9ac8,stroke:#4a1486,color:#fff;
    classDef ai fill:#f46d43,stroke:#a50f15,color:#fff;
    classDef storage fill:#cccccc,stroke:#888888,color:#000;
    classDef gpu fill:#e41a1c,stroke:#67000d,color:#fff;
    classDef infra fill:#f0f0f0,stroke:#bdbdbd,color:#000;
```
