# sulikz/st-wearable-devices architecture

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

- Interactive diagram: https://gitdiagram.com/sulikz/st-wearable-devices
- Repository: https://github.com/sulikz/st-wearable-devices

## Overview

Wearable Devices is a STALKER Anomaly mod whose supplied runtime files are shader assets. Its visible rendering workflow is per-profile: CRT shaders sample device UI, optionally apply arc-field distortion, then add CRT patterning and screen effects. Other shader branches render arc-style gauges and body fills, tube glow, and deferred HUD surfaces. The tree and excerpts do not show how the game loads these shaders or how any script supplies their uniforms, so those connections are omitted.

Main entry points: [`gamedata/shaders/r3/wd_crt.h`](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_crt.h) (CRT renderer), [`gamedata/shaders/r2/wd_crt.h`](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r2/wd_crt.h) (CRT renderer), [`gamedata/shaders/r3/wd_arc_field.h`](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_arc_field.h) (Arc field model), [`gamedata/shaders/r1/wd_crt.h`](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r1/wd_crt.h) (CRT renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_r1["Shader profile R1"]
  node_r1_crt["CRT renderer<br/>[wd_crt.h]"]
  node_r1_input["CRT input<br/>[wd_crt_input.h]"]
  node_r1_sample["UI sampling<br/>[wd_sample_ui.h]"]
  node_r1_arc["Arc gauge<br/>[wd_face_arc.h]"]
  node_r1_body["Body fill<br/>[wd_body_fill.h]"]
  node_r1_nixie["Nixie glow<br/>[wd_nixie_glow.h]"]
end

subgraph group_r2["Shader profile R2"]
  node_r2_crt["CRT renderer<br/>[wd_crt.h]"]
  node_r2_input["CRT input<br/>[wd_crt_input.h]"]
  node_r2_sample["UI sampling<br/>[wd_sample_ui.h]"]
  node_r2_arc["Arc gauge<br/>[wd_face_arc.h]"]
  node_r2_body["Body fill<br/>[wd_body_fill.h]"]
  node_r2_field["CRT field effects<br/>[wd_screen_fx.h]"]
  node_r2_hud["Deferred HUD<br/>[wd_deffer_hud.h]"]
  node_r2_normal["Normal perturbation"]
  node_r2_glass["Glass surface<br/>[wd_glass.h]"]
end

subgraph group_r3["Shader profile R3"]
  node_r3_crt["CRT renderer<br/>[wd_crt.h]"]
  node_r3_input["CRT input<br/>[wd_crt_input.h]"]
  node_r3_sample["UI sampling"]
  node_r3_arc["Arc field model<br/>[wd_arc_field.h]"]
  node_r3_hash["Field hashing<br/>[wd_hash.h]"]
  node_r3_field["CRT field effects<br/>[wd_crt_field.h]"]
  node_r3_screen["Screen effects<br/>[wd_screen_fx.h]"]
  node_r3_arc_gauge["Arc gauge<br/>[wd_face_arc.h]"]
  node_r3_body["Body fill<br/>[wd_body_fill.h]"]
  node_r3_nixie["Nixie glow<br/>[wd_nixie_glow.h]"]
  node_r3_hud["Deferred HUD<br/>[wd_deffer_hud.h]"]
  node_r3_normal["Normal perturbation"]
  node_r3_glass["Glass surface<br/>[wd_glass.h]"]
end

node_r1_crt -->|"uses input"| node_r1_input
node_r1_crt -->|"samples UI"| node_r1_sample
node_r1_arc -->|"samples UI"| node_r1_sample
node_r1_body -->|"uses gauge"| node_r1_arc
node_r1_nixie -->|"uses field helpers"| node_r1_input
node_r2_crt -->|"uses input"| node_r2_input
node_r2_crt -->|"samples UI"| node_r2_sample
node_r2_crt -->|"applies effects"| node_r2_field
node_r2_arc -->|"samples UI"| node_r2_sample
node_r2_body -->|"uses gauge"| node_r2_arc
node_r2_hud -->|"perturbs normals"| node_r2_normal
node_r3_crt -->|"uses input"| node_r3_input
node_r3_crt -->|"samples field"| node_r3_field
node_r3_crt -->|"applies effects"| node_r3_screen
node_r3_crt -.->|"samples UI"| node_r3_sample
node_r3_field -->|"reads field"| node_r3_arc
node_r3_arc -->|"hashes bursts"| node_r3_hash
node_r3_screen -->|"hashes noise"| node_r3_hash
node_r3_arc_gauge -.->|"samples UI"| node_r3_sample
node_r3_body -->|"uses gauge"| node_r3_arc_gauge
node_r3_nixie -->|"uses field helpers"| node_r3_arc
node_r3_hud -->|"perturbs normals"| node_r3_normal

click node_r1_crt "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r1/wd_crt.h"
click node_r1_input "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r1/wd_crt_input.h"
click node_r1_sample "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r1/wd_sample_ui.h"
click node_r1_arc "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r1/wd_face_arc.h"
click node_r1_body "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r1/wd_body_fill.h"
click node_r1_nixie "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r1/wd_nixie_glow.h"
click node_r2_crt "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r2/wd_crt.h"
click node_r2_input "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r2/wd_crt_input.h"
click node_r2_sample "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r2/wd_sample_ui.h"
click node_r2_arc "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r2/wd_face_arc.h"
click node_r2_body "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r2/wd_body_fill.h"
click node_r2_field "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r2/wd_screen_fx.h"
click node_r2_hud "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r2/wd_deffer_hud.h"
click node_r2_normal "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r2/wd_perturb_normal.h"
click node_r2_glass "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r2/wd_glass.h"
click node_r3_crt "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_crt.h"
click node_r3_input "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_crt_input.h"
click node_r3_arc "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_arc_field.h"
click node_r3_hash "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_hash.h"
click node_r3_field "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_crt_field.h"
click node_r3_screen "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_screen_fx.h"
click node_r3_arc_gauge "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_face_arc.h"
click node_r3_body "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_body_fill.h"
click node_r3_nixie "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_nixie_glow.h"
click node_r3_hud "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_deffer_hud.h"
click node_r3_normal "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_perturb_normal.h"
click node_r3_glass "https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_glass.h"

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_r1_crt,node_r1_input,node_r1_sample,node_r1_arc,node_r1_body,node_r1_nixie toneBlue
class node_r2_crt,node_r2_input,node_r2_sample,node_r2_arc,node_r2_body,node_r2_field,node_r2_hud,node_r2_normal,node_r2_glass toneAmber
class node_r3_crt,node_r3_input,node_r3_sample,node_r3_arc,node_r3_hash,node_r3_field,node_r3_screen,node_r3_arc_gauge,node_r3_body,node_r3_nixie,node_r3_hud,node_r3_normal,node_r3_glass toneMint
```

## Components

### Shader profile R1

- [CRT renderer](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r1/wd_crt.h): `gamedata/shaders/r1/wd_crt.h`
- [CRT input](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r1/wd_crt_input.h): `gamedata/shaders/r1/wd_crt_input.h`
- [UI sampling](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r1/wd_sample_ui.h): `gamedata/shaders/r1/wd_sample_ui.h`
- [Arc gauge](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r1/wd_face_arc.h): `gamedata/shaders/r1/wd_face_arc.h`
- [Body fill](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r1/wd_body_fill.h): `gamedata/shaders/r1/wd_body_fill.h`
- [Nixie glow](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r1/wd_nixie_glow.h): `gamedata/shaders/r1/wd_nixie_glow.h`

### Shader profile R2

- [CRT renderer](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r2/wd_crt.h): `gamedata/shaders/r2/wd_crt.h`
- [CRT input](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r2/wd_crt_input.h): `gamedata/shaders/r2/wd_crt_input.h`
- [UI sampling](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r2/wd_sample_ui.h): `gamedata/shaders/r2/wd_sample_ui.h`
- [Arc gauge](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r2/wd_face_arc.h): `gamedata/shaders/r2/wd_face_arc.h`
- [Body fill](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r2/wd_body_fill.h): `gamedata/shaders/r2/wd_body_fill.h`
- [CRT field effects](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r2/wd_screen_fx.h): `gamedata/shaders/r2/wd_screen_fx.h`
- [Deferred HUD](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r2/wd_deffer_hud.h): `gamedata/shaders/r2/wd_deffer_hud.h`
- [Normal perturbation](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r2/wd_perturb_normal.h): `gamedata/shaders/r2/wd_perturb_normal.h`
- [Glass surface](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r2/wd_glass.h): `gamedata/shaders/r2/wd_glass.h`

### Shader profile R3

- [CRT renderer](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_crt.h): `gamedata/shaders/r3/wd_crt.h`
- [CRT input](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_crt_input.h): `gamedata/shaders/r3/wd_crt_input.h`
- **UI sampling**
- [Arc field model](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_arc_field.h): `gamedata/shaders/r3/wd_arc_field.h`
- [Field hashing](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_hash.h): `gamedata/shaders/r3/wd_hash.h`
- [CRT field effects](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_crt_field.h): `gamedata/shaders/r3/wd_crt_field.h`
- [Screen effects](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_screen_fx.h): `gamedata/shaders/r3/wd_screen_fx.h`
- [Arc gauge](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_face_arc.h): `gamedata/shaders/r3/wd_face_arc.h`
- [Body fill](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_body_fill.h): `gamedata/shaders/r3/wd_body_fill.h`
- [Nixie glow](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_nixie_glow.h): `gamedata/shaders/r3/wd_nixie_glow.h`
- [Deferred HUD](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_deffer_hud.h): `gamedata/shaders/r3/wd_deffer_hud.h`
- [Normal perturbation](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_perturb_normal.h): `gamedata/shaders/r3/wd_perturb_normal.h`
- [Glass surface](https://github.com/sulikz/st-wearable-devices/blob/main/gamedata/shaders/r3/wd_glass.h): `gamedata/shaders/r3/wd_glass.h`

## Connections

- CRT renderer → CRT input: uses input (evidence: `gamedata/shaders/r1/wd_crt.h`)
- CRT renderer → UI sampling: samples UI (evidence: `gamedata/shaders/r1/wd_crt.h`)
- Arc gauge → UI sampling: samples UI (evidence: `gamedata/shaders/r1/wd_face_arc.h`)
- Body fill → Arc gauge: uses gauge (evidence: `gamedata/shaders/r1/wd_body_fill.h`)
- Nixie glow → CRT input: uses field helpers (evidence: `gamedata/shaders/r1/wd_nixie_glow.h`)
- CRT renderer → CRT input: uses input (evidence: `gamedata/shaders/r2/wd_crt.h`)
- CRT renderer → UI sampling: samples UI (evidence: `gamedata/shaders/r2/wd_crt.h`)
- CRT renderer → CRT field effects: applies effects (evidence: `gamedata/shaders/r2/wd_crt.h`)
- Arc gauge → UI sampling: samples UI (evidence: `gamedata/shaders/r2/wd_face_arc.h`)
- Body fill → Arc gauge: uses gauge (evidence: `gamedata/shaders/r2/wd_body_fill.h`)
- Deferred HUD → Normal perturbation: perturbs normals (evidence: `gamedata/shaders/r2/wd_deffer_hud.h`)
- CRT renderer → CRT input: uses input (evidence: `gamedata/shaders/r3/wd_crt.h`)
- CRT renderer → CRT field effects: samples field (evidence: `gamedata/shaders/r3/wd_crt.h`)
- CRT renderer → Screen effects: applies effects (evidence: `gamedata/shaders/r3/wd_crt.h`)
- CRT renderer → UI sampling: samples UI
- CRT field effects → Arc field model: reads field (evidence: `gamedata/shaders/r3/wd_crt_field.h`)
- Arc field model → Field hashing: hashes bursts (evidence: `gamedata/shaders/r3/wd_arc_field.h`)
- Screen effects → Field hashing: hashes noise (evidence: `gamedata/shaders/r3/wd_screen_fx.h`)
- Arc gauge → UI sampling: samples UI
- Body fill → Arc gauge: uses gauge (evidence: `gamedata/shaders/r3/wd_body_fill.h`)
- Nixie glow → Arc field model: uses field helpers (evidence: `gamedata/shaders/r3/wd_nixie_glow.h`)
- Deferred HUD → Normal perturbation: perturbs normals (evidence: `gamedata/shaders/r3/wd_deffer_hud.h`)
