How doodlum/skyrim-community-shaders works
1. This repository is a Skyrim Special Edition / Skyrim VR SKSE plugin, not a standalone app. The runtime boundary is the game process: the DLL is loaded by SKSE, then the mod patches engine behavior, injects rendering logic, and renders its own UI over the game.
2. The codebase is split into a C++ plugin layer and a large shader/content layer. The C++ side lives mainly in src/, while feature-specific shader assets and feature metadata live under features/ and shared runtime shaders live under package/Shaders/.
3. The central runtime orchestration is in the core plugin files: src/XSEPlugin.cpp, src/Globals.*, src/State.*, src/Hooks.*, and src/Feature.*. These establish the plugin lifecycle, manage global state, register hooks into engine and rendering paths, and dispatch work to individual features.
4. Features are the main architectural unit. Each feature has a C++ implementation under src/Features/<Feature>.cpp|h and usually a shader/config package under features/<Feature Name>/Shaders/.... Examples include upscaling, water, weather editing, screen-space GI/shadows, terrain effects, and VR support. This is a modular feature system rather than a monolith.
5. Rendering is heavily shader-driven. Shared HLSL utilities in package/Shaders/Common/ and feature-specific shaders in package/Shaders/ or features/*/Shaders/ implement most visual effects. The C++ layer’s job is to bind resources, choose permutations, manage constants/buffers, and submit the correct shader passes at the right point in the frame.
6. There is a clear separation between engine-facing code and pure rendering/math code. Engine integration lives in modules like src/ShaderTools/, src/TruePBR/, src/Deferred.*, src/EngineFixes/, and utility wrappers in src/Utils/. Shared GPU-side abstractions are in package/Shaders/Common/, while the engine-facing C++ side handles hooks, state, and game data extraction.
7. Several subsystems are about fixing or extending Skyrim’s rendering pipeline itself, not just adding post-processing. Examples include Deferred, TruePBR, EngineFixes, LightLimitFix, TerrainShadows, VolumetricLighting, and ScreenSpaceShadows. These features likely sit on the boundary between game rendering internals and custom shader passes.
8. UI and configuration are another major subsystem. src/Menu/ implements the in-game Community Shaders menu, themeing, icons, fonts, and feature settings panes. The UI reads from feature metadata and runtime state, and in turn updates feature settings, overrides, and persisted configuration.
9. Weather and scene editing are specialized interactive subsystems. src/WeatherEditor/, src/WeatherManager.*, src/WeatherVariableRegistry.h, and src/SceneSettingsManager.cpp form a data-driven editor/manager layer that lets the plugin modify in-game weather, lighting, and related scene parameters through structured widgets and registries.
10. VR is treated as a first-class branch of the architecture, not a minor toggle. src/Features/VR.*, src/Features/VR/*, and package/Shaders/VR/ handle stereo rendering, overlay placement, input/drag interactions, and VR-specific compositing. The README also calls out a separate VR address library dependency, reinforcing that VR is an explicit runtime mode.
11. Upscaling is one of the most externally integrated subsystems. src/Features/Upscaling/ coordinates with AMD FidelityFX and NVIDIA Streamline/DLSS artifacts under include/FidelityFX/ and features/Upscaling/Shaders/Upscaling/FidelityFX|Streamline. This feature crosses the boundary between the plugin, the swap chain, and third-party SDKs.
12. The repo contains a packaging/distribution layer separate from runtime code. package/ holds the installable mod layout: SKSE plugin files, interface assets, themes, icons, and shipping shaders. The features/ directories appear to map to optional distributable feature packages, while the top-level build system can produce an AIO package or individual feature zips.
13. Build and validation are CMake-centric. CMakeLists.txt, vcpkg.json, and the cmake/ directory define compilation, dependency resolution, feature packaging, and SDK integration. GitHub Actions under .github/workflows/ automate build, lint, shader-change checks, and package-related tasks, while tests under tests/shaders/ focus on shader validation/discovery.
14. The main data flow is: game engine state and frame data come in through hooks → core state and utility layers normalize that data → feature modules decide what to do → shaders and buffers are prepared → GPU passes run → UI and editor modules expose controls back to the user. That flow is the key thing to capture in an architecture diagram.
15. In short, this is a modular graphics plugin platform for Skyrim: a core SKSE runtime, many independently packaged rendering/features modules, a shared shader library, an in-game configuration/editor UI, and optional integrations with VR and external upscaling SDKs.
Main entry points: Feature.h Feature core · XSEPlugin.cpp Plugin entry · State.h State · ShaderCompiler.h Shader tools
Components 20
Runtime Core
SKSE-loaded plugin logic inside the game process
- Plugin entry · Plugin lifecycle and startup boundary
src/XSEPlugin.cpp - Globals · Process-wide plugin globals and shared references
src/Globals.h - State · Central runtime state and feature coordination data
src/State.h - Hooks · Engine and render hook registration
src/Hooks.h - Feature core · Feature registration, dispatch, constraints, and metadata
src/Feature.h - Shader tools · Shader compilation, shader hooks, and binding utilities
src/ShaderTools/ShaderCompiler.h
Feature Modules
Modular rendering and gameplay-facing subsystems
- Deferred · Deferred rendering extensions and composite path
src/Deferred.h - True PBR · PBR material integration on the engine side
src/TruePBR.h - Engine fixes · Low-level fixes for rendering pipeline behavior
src/EngineFix.h - Upscaling · External upscaling and frame-generation integration
src/Features/Upscaling.h - Water effects · Water shading and displacement effects
src/Features/WaterEffects.h - Terrain shadows · Terrain shadow generation and heightmap-driven data
src/Features/TerrainShadows.h - Volumetric light · Volumetric lighting and related compositing passes
src/Features/VolumetricLighting.h
UI & Editors
In-game configuration and weather editing surfaces
- Weather editor · Weather and scene parameter editing subsystem
src/WeatherEditor/EditorWindow.h - Community menu · Feature settings, themes, and overlay UI
src/Menu.h
Shader Packages
Shared HLSL and packaged feature assets
- Shared shaders · Reusable GPU utilities and shared passes
package/Shaders/Common/BRDF.hlsli - Feature shaders · Per-feature shader payloads and config metadata
features/Upscaling/Shaders/Features/Upscaling.ini
Build & Ext
Build system, third-party SDKs, and test scaffolding
- Build system · Compilation, packaging, and dependency orchestration
CMakeLists.txt - External SDKs · CommonLibSSE-NG, FidelityFX, and Streamline integrations
extern/CommonLibSSE-NG - Shader tests · Shader discovery and validation test scaffolding
tests/shaders/CMakeLists.txt
Connections 23
- Plugin entry → Globals: initializes · Startup populates process-wide plugin globals
- Plugin entry → State: bootstraps · Creates and updates central runtime state
- Plugin entry → Hooks: registers · Installs engine and render hooks
- Plugin entry → Feature core: loads · Brings feature framework online
- Hooks → Shader tools: feeds frame data · Hooks extract render/game state for GPU work
- State → Feature core: drives · Runtime state informs feature decisions
- Feature core → Deferred: dispatches · Feature framework activates major rendering subsystems
- Feature core → True PBR: dispatches · Feature framework activates material pipeline support
- Feature core → Engine fixes: dispatches · Feature framework activates low-level fixes
- Feature core → Upscaling: dispatches · Feature framework activates swapchain/upscaling feature
- Feature core → Water effects: dispatches · Feature framework activates water feature
- Feature core → Terrain shadows: dispatches · Feature framework activates terrain shadow feature
- Feature core → Volumetric light: dispatches · Feature framework activates volumetric lighting feature
- Feature core → Weather editor: exposes · Feature framework contributes editor-controlled systems
- Feature core → Community menu: configures · Feature metadata and settings surface in the menu
- Community menu → State: reads/writes · UI reflects and mutates runtime settings and state
- Weather editor → State: edits · Weather tools modify live scene and weather state
- Shader tools → Shared shaders: compiles · Shader tooling consumes shared HLSL library code
- Shader tools → Feature shaders: builds · Shader tooling compiles per-feature shader packages
- Upscaling → External SDKs: integrates · Upscaling uses FidelityFX and Streamline SDKs
- Build system → External SDKs: resolves · CMake manages third-party dependency integration
- Build system → Shader tests: validates · Build pipeline includes shader discovery and validation
- Feature shaders → Shared shaders: extends · Feature packages sit on top of shared shader utilities