# nljones/accelerad architecture

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

- Interactive diagram: https://gitdiagram.com/nljones/accelerad
- Repository: https://github.com/nljones/accelerad

## Overview

Radiance is a synthetic imaging and lighting simulation system. A typical user supplies a Radiance scene and parameters to `rad`, which controls the rendering process; the resulting image can then be converted for display. Around that workflow, the repository provides scene and weather-data conversion, daylight generation, ray-tracing and GPU rendering, interactive and holodeck viewers, image processing, and glare analysis. The README documents the main workflow and several capabilities; some subsystem connections are omitted because the sampled source does not show their runtime wiring.

Main entry points: [`src/util/rad.c`](https://github.com/nljones/accelerad/blob/combined/src/util/rad.c) (Render controller), [`src/rt/raytrace.c`](https://github.com/nljones/accelerad/blob/combined/src/rt/raytrace.c) (Ray tracing), [`src/px/ra_rgbe.c`](https://github.com/nljones/accelerad/blob/combined/src/px/ra_rgbe.c) (Image conversion), [`src/rt/optix_radiance.c`](https://github.com/nljones/accelerad/blob/combined/src/rt/optix_radiance.c) (GPU rendering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Rendering workflow"]
  node_rad["Render controller<br/>[rad.c]"]
  node_common["Shared runtime"]
end

subgraph group_scene["Scene and daylight"]
  node_sceneconvert["Scene conversion"]
  node_octree["Scene octree<br/>[oconv.c]"]
  node_daylight["Daylight generation<br/>[gendaylit.c]"]
  node_weather["Weather matrices<br/>[gendaymtx.c]"]
  node_bsdf["BSDF queries<br/>[bsdfquery.c]"]
end

subgraph group_render["Rendering engines"]
  node_raytrace["Ray tracing<br/>[raytrace.c]"]
  node_optix["GPU rendering<br/>[optix_radiance.c]"]
  node_holodeck["Holodeck tools<br/>[rholo.c]"]
  node_contrib["Contribution tracing<br/>[rcontrib.c]"]
end

subgraph group_view["Viewing and images"]
  node_imageconvert["Image conversion<br/>[ra_rgbe.c]"]
  node_imageprocess["Image processing<br/>[pcond.c]"]
  node_x11viewer["X11 viewer<br/>[x11image.c]"]
  node_glrad["Holodeck viewer<br/>[rhd_ogl.c]"]
  node_qtrvu["Qt viewer<br/>[qt.c]"]
end

subgraph group_analysis["Analysis and utilities"]
  node_glare["Glare analysis<br/>[evalglare.c]"]
  node_animation["Animation control<br/>[ranimate.c]"]
  node_calculation["Calculation tools<br/>[rcalc.c]"]
  node_plotting["Plotting tools<br/>[mgraph.c]"]
end

node_user(("Radiance user"))
node_x11(("X11 system"))
node_gpu(("GPU runtime"))

node_user -->|"runs"| node_rad
node_rad -->|"controls rendering"| node_raytrace
node_raytrace -.->|"produces image"| node_imageconvert
node_user -->|"converts image"| node_imageconvert
node_x11viewer -->|"creates window"| node_x11
node_optix -.->|"uses GPU"| node_gpu

click node_rad "https://github.com/nljones/accelerad/blob/combined/src/util/rad.c"
click node_raytrace "https://github.com/nljones/accelerad/blob/combined/src/rt/raytrace.c"
click node_optix "https://github.com/nljones/accelerad/blob/combined/src/rt/optix_radiance.c"
click node_holodeck "https://github.com/nljones/accelerad/blob/combined/src/hd/rholo.c"
click node_contrib "https://github.com/nljones/accelerad/blob/combined/src/rt/rcontrib.c"
click node_sceneconvert "https://github.com/nljones/accelerad/tree/combined/src/cv"
click node_octree "https://github.com/nljones/accelerad/blob/combined/src/ot/oconv.c"
click node_daylight "https://github.com/nljones/accelerad/blob/combined/src/gen/gendaylit.c"
click node_weather "https://github.com/nljones/accelerad/blob/combined/src/gen/gendaymtx.c"
click node_bsdf "https://github.com/nljones/accelerad/blob/combined/src/cv/bsdfquery.c"
click node_common "https://github.com/nljones/accelerad/tree/combined/src/common"
click node_imageconvert "https://github.com/nljones/accelerad/blob/combined/src/px/ra_rgbe.c"
click node_imageprocess "https://github.com/nljones/accelerad/blob/combined/src/px/pcond.c"
click node_x11viewer "https://github.com/nljones/accelerad/blob/combined/src/px/x11image.c"
click node_glrad "https://github.com/nljones/accelerad/blob/combined/src/hd/rhd_ogl.c"
click node_qtrvu "https://github.com/nljones/accelerad/blob/combined/src/qtrvu/qt.c"
click node_glare "https://github.com/nljones/accelerad/blob/combined/src/util/evalglare.c"
click node_animation "https://github.com/nljones/accelerad/blob/combined/src/util/ranimate.c"
click node_calculation "https://github.com/nljones/accelerad/blob/combined/src/cal/rcalc.c"
click node_plotting "https://github.com/nljones/accelerad/blob/combined/src/meta/mgraph.c"

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_rad,node_common,node_user toneBlue
class node_sceneconvert,node_octree,node_daylight,node_weather,node_bsdf toneAmber
class node_raytrace,node_optix,node_holodeck,node_contrib toneMint
class node_imageconvert,node_imageprocess,node_x11viewer,node_glrad,node_qtrvu toneRose
class node_glare,node_animation,node_calculation,node_plotting,node_x11,node_gpu toneIndigo
```

## Components

### Rendering workflow

- [Render controller](https://github.com/nljones/accelerad/blob/combined/src/util/rad.c): `src/util/rad.c`
- [Shared runtime](https://github.com/nljones/accelerad/tree/combined/src/common): `src/common`

### Scene and daylight

- [Scene conversion](https://github.com/nljones/accelerad/tree/combined/src/cv): `src/cv`
- [Scene octree](https://github.com/nljones/accelerad/blob/combined/src/ot/oconv.c): `src/ot/oconv.c`
- [Daylight generation](https://github.com/nljones/accelerad/blob/combined/src/gen/gendaylit.c): `src/gen/gendaylit.c`
- [Weather matrices](https://github.com/nljones/accelerad/blob/combined/src/gen/gendaymtx.c): `src/gen/gendaymtx.c`
- [BSDF queries](https://github.com/nljones/accelerad/blob/combined/src/cv/bsdfquery.c): `src/cv/bsdfquery.c`

### Rendering engines

- [Ray tracing](https://github.com/nljones/accelerad/blob/combined/src/rt/raytrace.c): `src/rt/raytrace.c`
- [GPU rendering](https://github.com/nljones/accelerad/blob/combined/src/rt/optix_radiance.c): `src/rt/optix_radiance.c`
- [Holodeck tools](https://github.com/nljones/accelerad/blob/combined/src/hd/rholo.c): `src/hd/rholo.c`
- [Contribution tracing](https://github.com/nljones/accelerad/blob/combined/src/rt/rcontrib.c): `src/rt/rcontrib.c`

### Viewing and images

- [Image conversion](https://github.com/nljones/accelerad/blob/combined/src/px/ra_rgbe.c): `src/px/ra_rgbe.c`
- [Image processing](https://github.com/nljones/accelerad/blob/combined/src/px/pcond.c): `src/px/pcond.c`
- [X11 viewer](https://github.com/nljones/accelerad/blob/combined/src/px/x11image.c): `src/px/x11image.c`
- [Holodeck viewer](https://github.com/nljones/accelerad/blob/combined/src/hd/rhd_ogl.c): `src/hd/rhd_ogl.c`
- [Qt viewer](https://github.com/nljones/accelerad/blob/combined/src/qtrvu/qt.c): `src/qtrvu/qt.c`

### Analysis and utilities

- [Glare analysis](https://github.com/nljones/accelerad/blob/combined/src/util/evalglare.c): `src/util/evalglare.c`
- [Animation control](https://github.com/nljones/accelerad/blob/combined/src/util/ranimate.c): `src/util/ranimate.c`
- [Calculation tools](https://github.com/nljones/accelerad/blob/combined/src/cal/rcalc.c): `src/cal/rcalc.c`
- [Plotting tools](https://github.com/nljones/accelerad/blob/combined/src/meta/mgraph.c): `src/meta/mgraph.c`

### Other components

- **Radiance user**
- **X11 system**
- **GPU runtime**

## Connections

- Radiance user → Render controller: runs
- Render controller → Ray tracing: controls rendering
- Ray tracing → Image conversion: produces image
- Radiance user → Image conversion: converts image
- X11 viewer → X11 system: creates window (evidence: `src/px/x11image.c`)
- GPU rendering → GPU runtime: uses GPU
