How ubisoft/chroma works
Main Components
a. Operating System & Graphics Stack
• Windows 10/11 Desktop
• Direct3D 11 GPU driver & runtime
b. Chroma Application (single executable)
1. UI Layer
– Configuration UI (menus, sliders, screenshot button)
– INI Parser (reads/writes user settings)
2. Input/Control Layer
– HotKeyManager (registers global hotkeys)
– InputHelper (processes keyboard/mouse events)
3. Screen Capture Layer
– SimpleCapture (captures frame buffers via Win32/Direct3D APIs)
– Win32WindowEnumeration (locates the target window/monitor)
– capture.interop/composition.interop (CPPWinRT wrappers)
4. Shader Processing Layer
– Shader Loader/Compiler (hlsl → GPU bytecode)
– PixelShader modules (Default, Protanopia, Deutanopia, Tritanopia, Tritan, Greyscale)
– Vertex Shader (fullscreen quad)
5. Rendering/Output Layer
– D3D11 Swap Chain (presents the processed frame back on screen)
6. External Dependencies
– ManagedWrapper.lib (third‑party interop code)
– CPPWinRT (for composition/capture interop)
Relationships & Data Flow
– UI Layer ↔ INI Parser (load/save settings)
– Input Layer → UI Layer & Capture/Shader layers (hotkey toggles simulation on/off, screenshot trigger)
Architectural Patterns
• Modular layering: capture, processing, output decoupled behind well‑defined interfaces
• Separation of concerns: UI, input, capture, processing, rendering
• Use of external wrapper for WinRT interop and of resource files (.rc, shaders)
Technologies & Frameworks
• C++17, Windows SDK
• Direct3D 11 API (d3dHelpers, direct3d11.interop)
• CPPWinRT for composition/capture interop
• HLSL for pixel shaders
• Win32 APIs for window enumeration & input
• MSBuild/CMake & Visual Studio solution file