mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-04 08:35:55 +00:00
PostProcessing: Add support for user-supplied anaglyph shaders.
There are lots of different anaglyph glasses out there and there may be even more creative uses for stereoscopic post-processing shaders.
This commit is contained in:
parent
a93433a860
commit
262c3b19ec
14 changed files with 110 additions and 58 deletions
|
@ -30,14 +30,16 @@ std::string PostProcessingShaderConfiguration::LoadShader(std::string shader)
|
|||
shader = g_ActiveConfig.sPostProcessingShader;
|
||||
m_current_shader = shader;
|
||||
|
||||
const std::string sub_dir = (g_Config.iStereoMode == STEREO_ANAGLYPH) ? ANAGLYPH_DIR DIR_SEP : "";
|
||||
|
||||
// loading shader code
|
||||
std::string code;
|
||||
std::string path = File::GetUserPath(D_SHADERS_IDX) + shader + ".glsl";
|
||||
std::string path = File::GetUserPath(D_SHADERS_IDX) + sub_dir + shader + ".glsl";
|
||||
|
||||
if (!File::Exists(path))
|
||||
{
|
||||
// Fallback to shared user dir
|
||||
path = File::GetSysDirectory() + SHADERS_DIR DIR_SEP + shader + ".glsl";
|
||||
path = File::GetSysDirectory() + SHADERS_DIR DIR_SEP + sub_dir + shader + ".glsl";
|
||||
}
|
||||
|
||||
if (!File::ReadFileToString(path, code))
|
||||
|
|
|
@ -147,6 +147,7 @@ struct VideoConfig final
|
|||
std::vector<std::string> Adapters; // for D3D
|
||||
std::vector<std::string> AAModes;
|
||||
std::vector<std::string> PPShaders; // post-processing shaders
|
||||
std::vector<std::string> AnaglyphShaders; // anaglyph shaders
|
||||
|
||||
bool bSupportsExclusiveFullscreen;
|
||||
bool bSupportsDualSourceBlend;
|
||||
|
@ -158,6 +159,7 @@ struct VideoConfig final
|
|||
bool bSupportsBindingLayout; // Needed by ShaderGen, so must stay in VideoCommon
|
||||
bool bSupportsBBox;
|
||||
bool bSupportsGSInstancing; // Needed by GeometryShaderGen, so must stay in VideoCommon
|
||||
bool bSupportsPostProcessing;
|
||||
} backend_info;
|
||||
|
||||
// Utility
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue