# dairondanilo/filament-gltf-viewer-ios architecture

> Architecture diagram of the GitHub repository dairondanilo/filament-gltf-viewer-ios, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dairondanilo/filament-gltf-viewer-ios
- Repository: https://github.com/dairondanilo/filament-gltf-viewer-ios

## Overview

##### Project type and purpose
- This is an iOS demo application built in Objective-C++ that integrates the Filament real-time 3D rendering engine via CocoaPods.
- Its sole purpose is to load and display a glTF model (the BusterDrone) with physically based rendering and image-based lighting on a physical iPhone.

##### File structure
- Top level:
- Podfile & Podfile.lock – CocoaPods dependency definitions
- *.xcodeproj / *.xcworkspace – Xcode project and workspace (workspace includes pods)
- BusterDrone/ – glTF model and associated textures/binary
- default_env/ – pre-computed environment maps (.ktx) for IBL
- filament-cocoapods/ – main iOS app directory
- filament-cocoapods/ breakdown:
- AppDelegate.{h,m} & SceneDelegate.{h,m} – iOS application lifecycle
- ViewController.{h,m} – standard UIViewController stub
- FILViewController.{h,mm} – bridges UI and rendering view
- FILModelView.{h,mm} – core rendering component (Objective-C++ wrapper around Filament)
- Assets.xcassets, storyboards, Info.plist, main.m – standard iOS app scaffolding

##### README insights
- Highlights Podfile as integration point for pre-built Filament libraries
- Emphasizes FILModelView as load/render logic and FILViewController as controller
- Instructs on opening workspace and running on device

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Dependency Management Layer
    subgraph "Dependency Management" 
        direction TB
        Podfile["Podfile"]:::dep
        PodfileLock["Podfile.lock"]:::dep
        Workspace["filament-cocoapods.xcworkspace"]:::dep
        Xcodeproj["filament-cocoapods.xcodeproj"]:::dep
    end

    %% iOS Application Layer
    subgraph "iOS Application Layer"
        direction TB
        Main["main.m"]:::ios
        AppDelegate["AppDelegate"]:::ios
        SceneDelegate["SceneDelegate"]:::ios
        ViewController["ViewController"]:::ios
        FILViewController["FILViewController"]:::ios
    end

    %% Rendering Layer
    subgraph "Rendering Layer"
        direction TB
        FILModelView["FILModelView"]:::render
        FilamentEngine["Filament Engine"]:::render
        GPU["Metal GPU"]:::render
    end

    %% Asset Layer
    subgraph "Asset Layer"
        direction TB
        BusterDroneGLTF["scene.gltf"]:::asset
        BusterDroneBIN["scene.bin"]:::asset
        Textures["textures/"]:::asset
        EnvIBL["default_env_ibl.ktx"]:::asset
        EnvSky["default_env_skybox.ktx"]:::asset
    end

    %% Connections
    Podfile -->|integrates| FilamentEngine
    PodfileLock -->|locks deps| FilamentEngine
    Workspace -->|includes pods| FilamentEngine
    Xcodeproj -->|project build| FilamentEngine

    Main -->|launches| AppDelegate
    AppDelegate -->|initializes UI| SceneDelegate
    SceneDelegate -->|instantiates| FILViewController
    FILViewController -->|creates| FILModelView
    FILModelView -->|calls API| FilamentEngine
    FilamentEngine -->|renders| GPU
    FILModelView -->|loads| BusterDroneGLTF
    FILModelView -->|loads| BusterDroneBIN
    FILModelView -->|loads| Textures
    FILModelView -->|loads| EnvIBL
    FILModelView -->|loads| EnvSky
    GPU -->|frame output| FILModelView
    FILModelView -->|renders view| FILViewController

    %% Click Events
    click AppDelegate "https://github.com/dairondanilo/filament-gltf-viewer-ios/blob/main/filament-cocoapods/AppDelegate.h"
    click AppDelegate "https://github.com/dairondanilo/filament-gltf-viewer-ios/blob/main/filament-cocoapods/AppDelegate.m"
    click SceneDelegate "https://github.com/dairondanilo/filament-gltf-viewer-ios/blob/main/filament-cocoapods/SceneDelegate.h"
    click SceneDelegate "https://github.com/dairondanilo/filament-gltf-viewer-ios/blob/main/filament-cocoapods/SceneDelegate.m"
    click ViewController "https://github.com/dairondanilo/filament-gltf-viewer-ios/blob/main/filament-cocoapods/ViewController.h"
    click ViewController "https://github.com/dairondanilo/filament-gltf-viewer-ios/blob/main/filament-cocoapods/ViewController.m"
    click FILViewController "https://github.com/dairondanilo/filament-gltf-viewer-ios/blob/main/filament-cocoapods/FILViewController.h"
    click FILViewController "https://github.com/dairondanilo/filament-gltf-viewer-ios/blob/main/filament-cocoapods/FILViewController.mm"
    click FILModelView "https://github.com/dairondanilo/filament-gltf-viewer-ios/blob/main/filament-cocoapods/FILModelView.h"
    click FILModelView "https://github.com/dairondanilo/filament-gltf-viewer-ios/blob/main/filament-cocoapods/FILModelView.mm"
    click Main "https://github.com/dairondanilo/filament-gltf-viewer-ios/blob/main/filament-cocoapods/main.m"
    click Textures "https://github.com/dairondanilo/filament-gltf-viewer-ios/tree/main/BusterDrone/textures/"
    click BusterDroneGLTF "https://github.com/dairondanilo/filament-gltf-viewer-ios/blob/main/BusterDrone/scene.gltf"
    click BusterDroneBIN "https://github.com/dairondanilo/filament-gltf-viewer-ios/blob/main/BusterDrone/scene.bin"
    click EnvIBL "https://github.com/dairondanilo/filament-gltf-viewer-ios/blob/main/default_env/default_env_ibl.ktx"
    click EnvSky "https://github.com/dairondanilo/filament-gltf-viewer-ios/blob/main/default_env/default_env_skybox.ktx"
    click Podfile "https://github.com/dairondanilo/filament-gltf-viewer-ios/tree/main/Podfile"
    click PodfileLock "https://github.com/dairondanilo/filament-gltf-viewer-ios/blob/main/Podfile.lock"
    click Workspace "https://github.com/dairondanilo/filament-gltf-viewer-ios/blob/main/filament-cocoapods.xcworkspace"
    click Xcodeproj "https://github.com/dairondanilo/filament-gltf-viewer-ios/blob/main/filament-cocoapods.xcodeproj"

    %% Styles
    classDef ios fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef render fill:#90EE90,stroke:#000,stroke-width:1px
    classDef asset fill:#FFFACD,stroke:#000,stroke-width:1px
    classDef dep fill:#FFA500,stroke:#000,stroke-width:1px
```
