# joaovvbonatti/umbrart architecture

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

- Interactive diagram: https://gitdiagram.com/joaovvbonatti/umbrart
- Repository: https://github.com/joaovvbonatti/umbrart

## Overview

UmbraRT is a realtime C++/OpenGL ray tracer. Its main workflow initializes a window, camera, input, UI, scene, and renderer; loads an OBJ model and builds scene triangles; then repeatedly updates input, renders, exposes scene and render controls, and presents the result. The README documents primitive, material, and progressive-accumulation capabilities, but shader and asset files are absent from the supplied tree. Runtime links below are limited to main.cpp’s visible calls and README claims; unsampled internal wiring is left unasserted.

Main entry points: [`src/main.cpp`](https://github.com/joaovvbonatti/umbrart/blob/master/src/main.cpp) (App Loop), [`src/Renderer.cpp`](https://github.com/joaovvbonatti/umbrart/blob/master/src/Renderer.cpp) (Renderer), [`src/Scene.cpp`](https://github.com/joaovvbonatti/umbrart/blob/master/src/Scene.cpp) (Scene), [`src/Window.cpp`](https://github.com/joaovvbonatti/umbrart/blob/master/src/Window.cpp) (Window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_main["App Loop<br/>[main.cpp]"]
  node_window["Window<br/>[Window.cpp]"]
  node_camera["Camera<br/>[Camera.cpp]"]
end

subgraph group_scene["Scene and Geometry"]
  node_scene["Scene<br/>[Scene.cpp]"]
  node_primitives["Scene Primitives<br/>[Scene.h]"]
  node_materials["Materials<br/>[Material.h]"]
  node_model_loader["OBJ Loader<br/>[ModelLoader.cpp]"]
  node_model["Triangle Models<br/>[Model.h]"]
  node_triangle_build["Triangle Build<br/>[Scene.cpp]"]
end

subgraph group_render["Rendering"]
  node_renderer["Renderer<br/>[Renderer.cpp]"]
  node_shader["Shader<br/>[Shader.cpp]"]
  node_accumulation["Accumulation Buffer"]
  node_triangle_buffer["GPU Triangle Buffer<br/>[TriangleBuffer.cpp]"]
end

subgraph group_interaction["User Interaction"]
  node_input["Input<br/>[Input.cpp]"]
  node_debugui["Debug UI<br/>[DebugUI.cpp]"]
end

node_user(("User"))
node_opengl["OpenGL"]
node_imgui["Dear ImGui"]
node_glfw["GLFW"]

node_user -->|"controls"| node_input
node_main -->|"creates"| node_window
node_main -->|"configures"| node_camera
node_main -->|"updates"| node_input
node_main -->|"draws panels"| node_debugui
node_main -->|"creates"| node_scene
node_main -->|"loads OBJ"| node_model_loader
node_main -->|"builds triangles"| node_triangle_build
node_main -->|"renders"| node_renderer
node_main -->|"swaps buffers"| node_window
node_main -->|"polls events"| node_window
node_main -->|"resets on change"| node_accumulation
node_model_loader -->|"loads model"| node_model
node_scene -->|"organizes"| node_primitives
node_scene -->|"organizes"| node_model
node_triangle_build -->|"updates triangles"| node_scene
node_renderer -.->|"uses"| node_shader
node_renderer -.->|"accumulates samples"| node_accumulation
node_renderer -.->|"uploads triangles"| node_triangle_buffer
node_renderer -.->|"renders via"| node_opengl
node_debugui -.->|"uses"| node_imgui
node_window -.->|"uses"| node_glfw

click node_main "https://github.com/joaovvbonatti/umbrart/blob/master/src/main.cpp"
click node_window "https://github.com/joaovvbonatti/umbrart/blob/master/src/Window.cpp"
click node_camera "https://github.com/joaovvbonatti/umbrart/blob/master/src/Camera.cpp"
click node_input "https://github.com/joaovvbonatti/umbrart/blob/master/src/Input.cpp"
click node_debugui "https://github.com/joaovvbonatti/umbrart/blob/master/src/DebugUI.cpp"
click node_scene "https://github.com/joaovvbonatti/umbrart/blob/master/src/Scene.cpp"
click node_primitives "https://github.com/joaovvbonatti/umbrart/blob/master/include/Scene.h"
click node_materials "https://github.com/joaovvbonatti/umbrart/blob/master/include/Material.h"
click node_model_loader "https://github.com/joaovvbonatti/umbrart/blob/master/src/Model/ModelLoader.cpp"
click node_model "https://github.com/joaovvbonatti/umbrart/blob/master/src/Model/Model.h"
click node_triangle_build "https://github.com/joaovvbonatti/umbrart/blob/master/src/Scene.cpp"
click node_renderer "https://github.com/joaovvbonatti/umbrart/blob/master/src/Renderer.cpp"
click node_shader "https://github.com/joaovvbonatti/umbrart/blob/master/src/Shader.cpp"
click node_accumulation "https://github.com/joaovvbonatti/umbrart/blob/master/src/AccumulationBuffer.cpp"
click node_triangle_buffer "https://github.com/joaovvbonatti/umbrart/blob/master/src/TriangleBuffer.cpp"

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_window,node_camera,node_user,node_imgui toneBlue
class node_scene,node_primitives,node_materials,node_model_loader,node_model,node_triangle_build toneAmber
class node_renderer,node_shader,node_accumulation,node_triangle_buffer toneMint
class node_input,node_debugui toneRose
class node_opengl,node_glfw toneIndigo
```

## Components

### Application

- [App Loop](https://github.com/joaovvbonatti/umbrart/blob/master/src/main.cpp): `src/main.cpp`
- [Window](https://github.com/joaovvbonatti/umbrart/blob/master/src/Window.cpp): `src/Window.cpp`
- [Camera](https://github.com/joaovvbonatti/umbrart/blob/master/src/Camera.cpp): `src/Camera.cpp`

### Scene and Geometry

- [Scene](https://github.com/joaovvbonatti/umbrart/blob/master/src/Scene.cpp): `src/Scene.cpp`
- [Scene Primitives](https://github.com/joaovvbonatti/umbrart/blob/master/include/Scene.h): `include/Scene.h`
- [Materials](https://github.com/joaovvbonatti/umbrart/blob/master/include/Material.h): `include/Material.h`
- [OBJ Loader](https://github.com/joaovvbonatti/umbrart/blob/master/src/Model/ModelLoader.cpp): `src/Model/ModelLoader.cpp`
- [Triangle Models](https://github.com/joaovvbonatti/umbrart/blob/master/src/Model/Model.h): `src/Model/Model.h`
- [Triangle Build](https://github.com/joaovvbonatti/umbrart/blob/master/src/Scene.cpp): `src/Scene.cpp`

### Rendering

- [Renderer](https://github.com/joaovvbonatti/umbrart/blob/master/src/Renderer.cpp): `src/Renderer.cpp`
- [Shader](https://github.com/joaovvbonatti/umbrart/blob/master/src/Shader.cpp): `src/Shader.cpp`
- [Accumulation Buffer](https://github.com/joaovvbonatti/umbrart/blob/master/src/AccumulationBuffer.cpp): `src/AccumulationBuffer.cpp`
- [GPU Triangle Buffer](https://github.com/joaovvbonatti/umbrart/blob/master/src/TriangleBuffer.cpp): `src/TriangleBuffer.cpp`

### User Interaction

- [Input](https://github.com/joaovvbonatti/umbrart/blob/master/src/Input.cpp): `src/Input.cpp`
- [Debug UI](https://github.com/joaovvbonatti/umbrart/blob/master/src/DebugUI.cpp): `src/DebugUI.cpp`

### Other components

- **User**
- **OpenGL**
- **Dear ImGui**
- **GLFW**

## Connections

- User → Input: controls
- App Loop → Window: creates (evidence: `src/main.cpp`)
- App Loop → Camera: configures (evidence: `src/main.cpp`)
- App Loop → Input: updates (evidence: `src/main.cpp`)
- App Loop → Debug UI: draws panels (evidence: `src/main.cpp`)
- App Loop → Scene: creates (evidence: `src/main.cpp`)
- App Loop → OBJ Loader: loads OBJ (evidence: `src/main.cpp`)
- App Loop → Triangle Build: builds triangles (evidence: `src/main.cpp`)
- App Loop → Renderer: renders (evidence: `src/main.cpp`)
- App Loop → Window: swaps buffers (evidence: `src/main.cpp`)
- App Loop → Window: polls events (evidence: `src/main.cpp`)
- App Loop → Accumulation Buffer: resets on change (evidence: `src/main.cpp`)
- OBJ Loader → Triangle Models: loads model (evidence: `src/Model/ModelLoader.cpp`)
- Scene → Scene Primitives: organizes (evidence: `include/Scene.h`)
- Scene → Triangle Models: organizes
- Triangle Build → Scene: updates triangles
- Renderer → Shader: uses
- Renderer → Accumulation Buffer: accumulates samples
- Renderer → GPU Triangle Buffer: uploads triangles
- Renderer → OpenGL: renders via
- Debug UI → Dear ImGui: uses
- Window → GLFW: uses
