# ohkashi/snoweffect architecture

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

- Interactive diagram: https://gitdiagram.com/ohkashi/snoweffect
- Repository: https://github.com/ohkashi/snoweffect

## Overview

##### Project Type Analysis
This is a graphics application that implements a snow particle effect using DirectX 11, with a GUI component using Dear ImGui. It's a Windows-based desktop application focusing on real-time rendering.

##### Main Components

A. Core Components:
- DirectX 11 Rendering Pipeline
- Snow Particle System
- Camera System
- GUI System (ImGui)
- Resource Management

B. Supporting Components:
- Windows Application Layer
- Third-party Integration Layer

**┌─────────────────────────────────────┐**
- Windows Application       │
- ┘

**┌─────────────┐ ┌─────────────┐ ┌─────────────┐**
- D3DManager│ │SnowParticle │ │  D3DCamera  │
- ┘ └─────────────┘ └─────────────┘

**┌─────────────┐ ┌─────────────┐ ┌─────────────┐**
- SnowShader  │ │DirectX 11   │ │    ImGui    │
- ┘ └─────────────┘ └─────────────┘

##### Specific Implementation Details

a) Data Flow:
- Particle System → Shader → DirectX 11 Pipeline
- Camera → DirectX 11 Pipeline
- ImGui → DirectX 11 Pipeline

b) Component Responsibilities:
- D3DManager: DirectX device and swap chain management
- SnowParticle: Particle system simulation and state
- D3DCamera: View and projection matrices
- SnowShader: Particle rendering shaders
- ImGui: User interface and controls

##### External Dependencies
- DirectXTK (Microsoft DirectX Tool Kit)
- Dear ImGui
- WinReg (for settings management)

##### Resource Flow
Texture loading path:
- particle.dds → Resource Manager → Particle System

##### User Interface

Keep the focus on the real-time aspects of the system and the interaction between the particle simulation and the rendering pipeline, as these are the core features of this snow effect application.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Application Layer"
        WinApp["Windows Application"]:::app
        Settings["Settings Management"]:::app
    end

    subgraph "Core Systems"
        D3DMgr["D3D Manager"]:::core
        Snow["Snow Particle System"]:::sim
        Camera["Camera System"]:::core
    end

    subgraph "Rendering Pipeline"
        Shader["Snow Shader"]:::render
        DX11["DirectX 11"]:::render
        GUI["ImGui Interface"]:::ui
    end

    subgraph "Resources"
        Texture["particle.dds"]:::resource
        DirectXTK["DirectX Tool Kit"]:::external
    end

    %% Relationships
    WinApp --> D3DMgr
    WinApp --> Settings
    D3DMgr --> DX11
    Snow --> Shader
    Camera --> DX11
    Shader --> DX11
    GUI --> DX11
    Texture --> Snow
    DirectXTK --> DX11
    Settings --> Snow

    %% Click Events
    click WinApp "https://github.com/ohkashi/SnowEffect/blob/master/SnowEffect/SnowEffect.cpp"
    click Settings "https://github.com/ohkashi/SnowEffect/blob/master/3rdparty/WinReg-6.1.0/WinReg/WinReg.hpp"
    click D3DMgr "https://github.com/ohkashi/SnowEffect/blob/master/SnowEffect/D3DManager.cpp"
    click Snow "https://github.com/ohkashi/SnowEffect/blob/master/SnowEffect/SnowParticle.cpp"
    click Camera "https://github.com/ohkashi/SnowEffect/blob/master/SnowEffect/D3DCamera.cpp"
    click Shader "https://github.com/ohkashi/SnowEffect/blob/master/SnowEffect/SnowShader.cpp"
    click GUI "https://github.com/ohkashi/SnowEffect/blob/master/3rdparty/imgui/backends/imgui_impl_dx11.cpp"
    click Texture "https://github.com/ohkashi/SnowEffect/blob/master/SnowEffect/particle.dds"

    %% Styling
    classDef app fill:#f9f,stroke:#333,stroke-width:2px
    classDef core fill:#9cf,stroke:#333,stroke-width:2px
    classDef sim fill:#9f9,stroke:#333,stroke-width:2px
    classDef render fill:#69f,stroke:#333,stroke-width:2px
    classDef ui fill:#fc9,stroke:#333,stroke-width:2px
    classDef resource fill:#ff9,stroke:#333,stroke-width:2px
    classDef external fill:#ddd,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1["Application"]:::app
        L2["Core System"]:::core
        L3["Simulation"]:::sim
        L4["Rendering"]:::render
        L5["UI"]:::ui
        L6["Resource"]:::resource
        L7["External"]:::external
    end
```
