# rsodre/fulldomecameraforunity architecture

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

- Interactive diagram: https://gitdiagram.com/rsodre/fulldomecameraforunity
- Repository: https://github.com/rsodre/fulldomecameraforunity

## Overview

##### Project Type & Purpose
- This is a Unity‐based plugin/tool suite (Assets/FulldomeForUnity) aimed at rendering standard Unity scenes into Fulldome (“Domemaster”) output.
- It supports three distortion approaches:
– Fulldome Camera (cubemap→fisheye)
– VFX Graph (custom particle blocks)
– Shader Graph (vertex distortion)
- It includes example scenes, legacy implementations, and pipelines for HDRP, Standard, and Legacy renderers.
- It also offers external streaming integrations (Syphon, Spout, NDI).

##### File Structure for Architectural Clues
- Top level:
– Assets/… (the plugin code & resources)
– Packages/, ProjectSettings/ (Unity project config)
– Logs/, README.md, LICENSE, images/
- Under Assets/FulldomeForUnity:
– FulldomeCamera/ – C# scripts (core logic), shaders, prefabs → camera‐based cubemap approach
– Examples/ – demo Unity scenes & assets for each renderer variant
– Xperiments/VFXGraph – custom Visual Effect Graph blocks & example scenes
– Xperiments/VertexShader (ShaderGraph) – custom shader nodes & test scenes
- External integrations: KlakSyphon, KlakSpout, KlakNDI are referenced in README (not in code tree), but should appear as “optional streaming modules.”

##### Key Insights from README
- The core runs by attaching FulldomeCamera.cs to a GameObject, pointing it at the Main Camera.
- It invokes Camera.RenderToCubemap, stitches faces, then samples to Domemaster layout.
- Performance considerations: HDRP quality overrides, disabling post effects, etc.
- VFXGraph/ShaderGraph approaches bypass cubemap but require Unity’s SRP or custom nodes.
- Streaming output: Unity RenderTexture → Syphon/Spout/NDI → external VJ apps (Blendy Dome VJ).

##### Diagramming the System
a. Main Components
– Unity Host Environment (Editor/Player)
– Main Camera (user’s scene camera)
– FulldomeCamera Module
- Cubemap Renderer (6 faces via RenderToCubemap)
- Domemaster Extractor (shader or CPU)
- RenderTexture Output
– VFXGraph Module (custom VFX Blocks library)
– ShaderGraph Module (custom Vertex Shader Graph nodes)
– Example Scenes (demonstrations of each approach)
– External Streamers (KlakSyphon, KlakSpout, KlakNDI)
– External VJ Apps (Blendy Dome VJ, NDISyphon)
– ProjectSettings & Package Manager (HDRP Asset, manifest.json)

b. Relationships & Data Flow
1. Scene content → Main Camera →
- (Option A) FulldomeCamera:
– RenderToCubemap → Cubemap RT → Domemaster RT → Unity’s Output
- (Option B) VFXGraph: Scene particles → VFX Graph blocks → On‐screen distortion
- (Option C) ShaderGraph: Scene meshes → ShaderGraph distortion → On‐screen fisheye
2. RenderTexture Output → Optional Streamer Component → External App
3. External App → Dome Projection Hardware

c. Architectural Patterns & Principles
– Modular plugin design: separate folders for core, examples, experiments
– SRP‐aware modules (HDRP vs Standard vs Legacy)
– Editor vs Runtime separation (Scripts vs Editor scripts under “Editor” folders)
– Scriptable Render Pipeline overrides for performance
– Optional extensions via KlakSyphon/Spout/NDI (client‐server model for texture sharing)

d. Key Technologies/Libraries
– C# scripts (FulldomeCamera.cs, Capture.cs, PipelineChecker.cs)
– Unity APIs: Camera.RenderToCubemap, RenderTextures, SRP frame settings
– Shader Graph & HLSL shaders (ShCubemapToDome, custom ShaderGraph nodes)
– Visual Effect Graph custom blocks
– External plugins: KlakSyphon, KlakSpout, KlakNDI

## Diagram (Mermaid)

```mermaid
flowchart TB
    UnityHost["Unity Host Environment"]:::external
    ProjectSettings["Project Settings"]:::external
    PackageManager["Package Manager (manifest.json)"]:::external

    UnityHost --> SceneContent["Scene Content"]
    ProjectSettings -.-> UnityHost
    PackageManager -.-> UnityHost

    SceneContent --> MainCamera["Main Camera"]

    subgraph "Assets/FulldomeForUnity"
        direction TB

        subgraph "Core Cubemap → Fisheye Pipeline"
            direction TB
            CoreModule["FulldomeCamera Module"]:::core
            Scripts["Scripts"]:::core
            Shaders["Shaders"]:::core
            Legacy["Legacy Implementation"]:::core

            CoreModule --> Scripts
            CoreModule --> Shaders
            CoreModule --> Legacy

            Scripts --> ScriptDetails["FulldomeCamera.cs, PipelineChecker.cs, Lib.cs"]
            Shaders --> ShaderDetails["ShCubemapToDome.shader, ShCubemapToEquirect.shader"]
            Legacy --> LegacyDetails["FulldomeCameraLegacy.cs, Capture.cs"]
        end

        subgraph "VFXGraph Path"
            direction TB
            VFXModule["VFXGraph Module"]:::vfx
            VFXModule --> VFXProcess["VFX Blocks"]
        end

        subgraph "ShaderGraph Path"
            direction TB
            ShaderModule["ShaderGraph Module"]:::shader
            ShaderModule --> ShaderProcess["Vertex Shader Graph"]
        end

        RenderTex["RenderTexture Output"]:::external

        CoreModule --> RenderTex
        VFXModule --> RenderTex
        ShaderModule --> RenderTex

        subgraph Examples
            direction TB
            ExamplesNode["Example Scenes"]:::external
        end

        subgraph Resources
            direction TB
            AssetsRes["Core Asset Resources"]:::external
        end

        subgraph Documentation
            direction TB
            Docs["README & Documentation"]:::external
        end
    end

    RenderTex --> Streamers["Optional Streamer Modules"]:::external
    Streamers --> ExternalApps["External VJ Apps"]:::external
    ExternalApps --> DomeHardware["Dome Projection Hardware"]:::external

    click UnityHost "https://github.com/rsodre/fulldomecameraforunity/tree/master//"
    click ProjectSettings "https://github.com/rsodre/fulldomecameraforunity/tree/master//ProjectSettings"
    click PackageManager "https://github.com/rsodre/fulldomecameraforunity/blob/master//Packages/manifest.json"
    click CoreModule "https://github.com/rsodre/fulldomecameraforunity/tree/master/Assets/FulldomeForUnity/FulldomeCamera"
    click Scripts "https://github.com/rsodre/fulldomecameraforunity/tree/master/Assets/FulldomeForUnity/FulldomeCamera/Scripts"
    click Shaders "https://github.com/rsodre/fulldomecameraforunity/tree/master/Assets/FulldomeForUnity/FulldomeCamera/Shaders"
    click Legacy "https://github.com/rsodre/fulldomecameraforunity/tree/master/Assets/FulldomeForUnity/FulldomeCamera/Legacy"
    click VFXModule "https://github.com/rsodre/fulldomecameraforunity/tree/master/Assets/FulldomeForUnity/Xperiments/VFXGraph/VFXBlocks"
    click ShaderModule "https://github.com/rsodre/fulldomecameraforunity/tree/master/Assets/FulldomeForUnity/Xperiments/VertexShader"
    click ExamplesNode "https://github.com/rsodre/fulldomecameraforunity/tree/master/Assets/FulldomeForUnity/Examples"
    click AssetsRes "https://github.com/rsodre/fulldomecameraforunity/tree/master/Assets/FulldomeForUnity/Assets"
    click Docs "https://github.com/rsodre/fulldomecameraforunity/blob/master/Assets/FulldomeForUnity/README.txt"

    classDef core fill:#cfe2f3,stroke:#000,stroke-width:1px
    classDef vfx fill:#d9ead3,stroke:#000,stroke-width:1px
    classDef shader fill:#fce5cd,stroke:#000,stroke-width:1px
    classDef external fill:#e0e0e0,stroke:#000,stroke-width:1px
```
