# mordol/testskinnedmeshrendering architecture

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

- Interactive diagram: https://gitdiagram.com/mordol/testskinnedmeshrendering
- Repository: https://github.com/mordol/testskinnedmeshrendering

## Overview

##### Main Components

a. Animation Processing Pipeline:
- Animation Baker System
- Input: Skinned Mesh Animations
- Processing: Animation Baking System
- Output: Baked Animation Textures

b. Rendering Systems:
- Basic Rendering Pipeline
- BRG (Batch Rendering Group) Pipeline
- Instanced Rendering Pipeline
- SRP (Scriptable Render Pipeline) Integration

c. Test Framework:
- Performance Testing Components
- Scene Management
- Spawning Systems

##### Component Relationships

**[Animation Source]**
- ↓
**[Animation Baker]**
- ↙     ↘
**[Texture Storage] [Animation Info]**
- ↓         ↓
**[Shader System] ← [Animation Control]**
- ↓
**[Rendering Pipelines]**
- [Basic Unlit]
- [BRG Pipeline]
- [Instanced Pipeline]
- [SRP Pipeline]

##### Specific Implementation Details

a. Animation Baker Components:
- BakedAnimationControl
- BakedAnimationInfo
- AnimationBakerUtil
- AnimationBakerWindow

b. Shader Systems:
- Basic Shaders
- BRG Shaders
- Compute Shaders
- SRP Shaders

c. Test Implementation:
- Grid Spawners
- Tracking Systems
- Performance Monitors

##### Data Flow Indicators

- Animation data flow
- Texture generation paths
- Rendering pipeline selection
- Performance data collection

##### Integration Points

Connections between:
- Animation baker and Unity's animation system
- Custom shaders and Unity's rendering pipeline
- Test framework and performance measurement tools

##### Clear data flow between components

Keep the abstraction level focused on the core systems while maintaining enough detail to show the unique aspects of the animation baking and rendering optimization approach.

This system design should help developers understand:
- How animations are processed and baked
- Where performance optimizations occur
- How different rendering pipelines are implemented
- How the testing framework validates performance

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Animation Processing"
        AnimSource["Animation Source"]:::source
        AnimBaker["Animation Baker System"]:::baker
        click AnimBaker "https://github.com/mordol/TestSkinnedMeshRendering/tree/main/Assets/AnimationBaker/Scripts/"
        BakedControl["Baked Animation Control"]:::control
        click BakedControl "https://github.com/mordol/TestSkinnedMeshRendering/blob/main/Assets/AnimationBaker/Scripts/BakedAnimationControl.cs"
        BakedInfo["Baked Animation Info"]:::info
        click BakedInfo "https://github.com/mordol/TestSkinnedMeshRendering/blob/main/Assets/AnimationBaker/Scripts/BakedAnimationInfo.cs"
        BakerUtil["Animation Baker Util"]:::util
        click BakerUtil "https://github.com/mordol/TestSkinnedMeshRendering/blob/main/Assets/AnimationBaker/Scripts/Editor/AnimationBakerUtil.cs"
        BakerWindow["Animation Baker Window"]:::window
        click BakerWindow "https://github.com/mordol/TestSkinnedMeshRendering/blob/main/Assets/AnimationBaker/Scripts/Editor/AnimationBakerWindow.cs"
    end

    subgraph "Storage Layer"
        TextureStore["Texture Storage"]:::storage
        AnimInfo["Animation Info"]:::storage
    end

    subgraph "Compute Shader System"
        BasicFrame["Basic Frame Compute"]:::compute
        click BasicFrame "https://github.com/mordol/TestSkinnedMeshRendering/blob/main/Assets/AnimationBaker/Shaders/BakedAnimationFrame.compute"
        BRGProcess["BRG Processing"]:::compute
        click BRGProcess "https://github.com/mordol/TestSkinnedMeshRendering/blob/main/Assets/AnimationBaker/Shaders/BakedAnimationFrameForBRG.compute"
        BRGPush["BRG Push"]:::compute
        click BRGPush "https://github.com/mordol/TestSkinnedMeshRendering/blob/main/Assets/AnimationBaker/Shaders/BakedAnimationFrameForBRG_Push.compute"
        BRGTrack["BRG Track"]:::compute
        click BRGTrack "https://github.com/mordol/TestSkinnedMeshRendering/blob/main/Assets/AnimationBaker/Shaders/BakedAnimationFrameForBRG_Track.compute"
    end

    subgraph "Rendering Pipelines"
        BasicRender["Basic Unlit Pipeline"]:::render
        click BasicRender "https://github.com/mordol/TestSkinnedMeshRendering/blob/main/Assets/AnimationBaker/Shaders/BasicUnlitShader.shader"
        BRGPipeline["BRG Pipeline"]:::render
        click BRGPipeline "https://github.com/mordol/TestSkinnedMeshRendering/blob/main/Assets/AnimationBaker/Shaders/BRGUnlitShader.shader"
        InstPipeline["Instanced Pipeline"]:::render
        click InstPipeline "https://github.com/mordol/TestSkinnedMeshRendering/blob/main/Assets/AnimationBaker/Shaders/InstancedBakedAniamtion.shader"
        SRPPipeline["SRP Pipeline"]:::render
        click SRPPipeline "https://github.com/mordol/TestSkinnedMeshRendering/blob/main/Assets/AnimationBaker/Shaders/SRPBakedAniamtion.shader"
    end

    subgraph "Testing Framework"
        GridSpawn["Grid Spawner"]:::test
        click GridSpawn "https://github.com/mordol/TestSkinnedMeshRendering/blob/main/Assets/Scripts/GridSpawner.cs"
        BRGTest["BRG Grid Spawner"]:::test
        click BRGTest "https://github.com/mordol/TestSkinnedMeshRendering/blob/main/Assets/Scripts/BRGGridSpawner.cs"
        InstTest["Instanced Grid Spawner"]:::test
        click InstTest "https://github.com/mordol/TestSkinnedMeshRendering/blob/main/Assets/Scripts/InstancedGridSpawner.cs"
        TestScenes["Test Scenes"]:::test
        click TestScenes "https://github.com/mordol/TestSkinnedMeshRendering/tree/main/Assets/Scenes/"
    end

    AnimSource --> AnimBaker
    AnimBaker --> |"Processes"| BakedControl
    AnimBaker --> |"Configures"| BakedInfo
    BakerUtil --> |"Utilities"| AnimBaker
    BakerWindow --> |"UI Control"| AnimBaker
    
    BakedControl --> TextureStore
    BakedInfo --> AnimInfo
    
    TextureStore --> BasicFrame
    TextureStore --> BRGProcess
    AnimInfo --> BRGPush
    BRGProcess --> BRGTrack
    
    BasicFrame --> BasicRender
    BRGTrack --> BRGPipeline
    TextureStore --> InstPipeline
    TextureStore --> SRPPipeline
    
    GridSpawn --> BasicRender
    BRGTest --> BRGPipeline
    InstTest --> InstPipeline
    TestScenes --> |"Validates"| BasicRender
    TestScenes --> |"Validates"| BRGPipeline
    TestScenes --> |"Validates"| InstPipeline
    TestScenes --> |"Validates"| SRPPipeline

    classDef source fill:#6495ED
    classDef baker fill:#4169E1
    classDef control fill:#1E90FF
    classDef info fill:#00BFFF
    classDef util fill:#87CEEB
    classDef window fill:#87CEFA
    classDef storage fill:#98FB98
    classDef compute fill:#FFA500
    classDef render fill:#DDA0DD
    classDef test fill:#D3D3D3

    %% Legend
    subgraph Legend
        L1["Animation Source"]:::source
        L2["Processing Systems"]:::baker
        L3["Storage Systems"]:::storage
        L4["Compute Systems"]:::compute
        L5["Rendering Systems"]:::render
        L6["Testing Systems"]:::test
    end
```
