mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Merge pull request #1766 from Armada651/enable-stereo
Enable stereoscopy settings.
This commit is contained in:
@ -53,10 +53,10 @@ void GeometryShaderManager::SetConstants()
|
||||
|
||||
if (xfmem.projection.type == GX_PERSPECTIVE)
|
||||
{
|
||||
float offset = (g_ActiveConfig.iStereoSeparation / 1000.0f) * (g_ActiveConfig.iStereoSeparationPercent / 100.0f);
|
||||
constants.stereoparams[0] = (g_ActiveConfig.bStereoSwapEyes) ? offset : -offset;
|
||||
constants.stereoparams[1] = (g_ActiveConfig.bStereoSwapEyes) ? -offset : offset;
|
||||
constants.stereoparams[2] = (g_ActiveConfig.iStereoConvergence / 10.0f) * (g_ActiveConfig.iStereoConvergencePercent / 100.0f);
|
||||
float offset = (g_ActiveConfig.iStereoDepth / 1000.0f) * (g_ActiveConfig.iStereoDepthPercentage / 100.0f);
|
||||
constants.stereoparams[0] = g_ActiveConfig.bStereoSwapEyes ? offset : -offset;
|
||||
constants.stereoparams[1] = g_ActiveConfig.bStereoSwapEyes ? -offset : offset;
|
||||
constants.stereoparams[2] = g_ActiveConfig.iStereoConvergence * (g_ActiveConfig.iStereoConvergencePercent / 100.0f);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -117,7 +117,7 @@ void TextureCache::OnConfigChanged(VideoConfig& config)
|
||||
}
|
||||
|
||||
if ((config.iStereoMode > 0) != backup_config.s_stereo_3d ||
|
||||
config.bStereoMonoEFBDepth != backup_config.s_mono_efb_depth)
|
||||
config.bStereoEFBMonoDepth != backup_config.s_efb_mono_depth)
|
||||
{
|
||||
g_texture_cache->DeleteShaders();
|
||||
g_texture_cache->CompileShaders();
|
||||
@ -134,7 +134,7 @@ void TextureCache::OnConfigChanged(VideoConfig& config)
|
||||
backup_config.s_hires_textures = config.bHiresTextures;
|
||||
backup_config.s_copy_cache_enable = config.bEFBCopyCacheEnable;
|
||||
backup_config.s_stereo_3d = config.iStereoMode > 0;
|
||||
backup_config.s_mono_efb_depth = config.bStereoMonoEFBDepth;
|
||||
backup_config.s_efb_mono_depth = config.bStereoEFBMonoDepth;
|
||||
}
|
||||
|
||||
void TextureCache::Cleanup()
|
||||
|
@ -146,7 +146,7 @@ private:
|
||||
bool s_hires_textures;
|
||||
bool s_copy_cache_enable;
|
||||
bool s_stereo_3d;
|
||||
bool s_mono_efb_depth;
|
||||
bool s_efb_mono_depth;
|
||||
} backup_config;
|
||||
};
|
||||
|
||||
|
@ -40,9 +40,9 @@ VideoConfig::VideoConfig()
|
||||
backend_info.bSupportsExclusiveFullscreen = false;
|
||||
|
||||
// Game-specific stereoscopy settings
|
||||
bStereoMonoEFBDepth = false;
|
||||
iStereoSeparationPercent = 100;
|
||||
iStereoConvergencePercent = 100;
|
||||
bStereoEFBMonoDepth = false;
|
||||
iStereoDepthPercentage = 100;
|
||||
iStereoConvergencePercentage = 100;
|
||||
}
|
||||
|
||||
void VideoConfig::Load(const std::string& ini_file)
|
||||
@ -88,7 +88,7 @@ void VideoConfig::Load(const std::string& ini_file)
|
||||
enhancements->Get("MaxAnisotropy", &iMaxAnisotropy, 0); // NOTE - this is x in (1 << x)
|
||||
enhancements->Get("PostProcessingShader", &sPostProcessingShader, "");
|
||||
enhancements->Get("StereoMode", &iStereoMode, 0);
|
||||
enhancements->Get("StereoSeparation", &iStereoSeparation, 20);
|
||||
enhancements->Get("StereoDepth", &iStereoDepth, 20);
|
||||
enhancements->Get("StereoConvergence", &iStereoConvergence, 20);
|
||||
enhancements->Get("StereoSwapEyes", &bStereoSwapEyes, false);
|
||||
|
||||
@ -185,13 +185,13 @@ void VideoConfig::GameIniLoad()
|
||||
CHECK_SETTING("Video_Enhancements", "MaxAnisotropy", iMaxAnisotropy); // NOTE - this is x in (1 << x)
|
||||
CHECK_SETTING("Video_Enhancements", "PostProcessingShader", sPostProcessingShader);
|
||||
CHECK_SETTING("Video_Enhancements", "StereoMode", iStereoMode);
|
||||
CHECK_SETTING("Video_Enhancements", "StereoSeparation", iStereoSeparation);
|
||||
CHECK_SETTING("Video_Enhancements", "StereoDepth", iStereoDepth);
|
||||
CHECK_SETTING("Video_Enhancements", "StereoConvergence", iStereoConvergence);
|
||||
CHECK_SETTING("Video_Enhancements", "StereoSwapEyes", bStereoSwapEyes);
|
||||
|
||||
CHECK_SETTING("Video_Stereoscopy", "StereoMonoEFBDepth", bStereoMonoEFBDepth);
|
||||
CHECK_SETTING("Video_Stereoscopy", "StereoSeparationPercent", iStereoSeparationPercent);
|
||||
CHECK_SETTING("Video_Stereoscopy", "StereoConvergencePercent", iStereoConvergencePercent);
|
||||
CHECK_SETTING("Video_Stereoscopy", "StereoEFBMonoDepth", bStereoEFBMonoDepth);
|
||||
CHECK_SETTING("Video_Stereoscopy", "StereoDepthPercentage", iStereoDepthPercentage);
|
||||
CHECK_SETTING("Video_Stereoscopy", "StereoConvergencePercentage", iStereoConvergencePercentage);
|
||||
|
||||
CHECK_SETTING("Video_Hacks", "EFBAccessEnable", bEFBAccessEnable);
|
||||
CHECK_SETTING("Video_Hacks", "EFBCopyEnable", bEFBCopyEnable);
|
||||
@ -276,7 +276,7 @@ void VideoConfig::Save(const std::string& ini_file)
|
||||
enhancements->Set("MaxAnisotropy", iMaxAnisotropy);
|
||||
enhancements->Set("PostProcessingShader", sPostProcessingShader);
|
||||
enhancements->Set("StereoMode", iStereoMode);
|
||||
enhancements->Set("StereoSeparation", iStereoSeparation);
|
||||
enhancements->Set("StereoDepth", iStereoDepth);
|
||||
enhancements->Set("StereoConvergence", iStereoConvergence);
|
||||
enhancements->Set("StereoSwapEyes", bStereoSwapEyes);
|
||||
|
||||
|
@ -81,7 +81,7 @@ struct VideoConfig final
|
||||
int iMaxAnisotropy;
|
||||
std::string sPostProcessingShader;
|
||||
int iStereoMode;
|
||||
int iStereoSeparation;
|
||||
int iStereoDepth;
|
||||
int iStereoConvergence;
|
||||
bool bStereoSwapEyes;
|
||||
|
||||
@ -126,9 +126,11 @@ struct VideoConfig final
|
||||
int iSaveTargetId; // TODO: Should be dropped
|
||||
|
||||
// Stereoscopy
|
||||
bool bStereoMonoEFBDepth;
|
||||
bool bStereoEFBMonoDepth;
|
||||
int iStereoSeparationPercent;
|
||||
int iStereoConvergencePercent;
|
||||
int iStereoDepthPercentage;
|
||||
int iStereoConvergencePercentage;
|
||||
|
||||
// D3D only config, mostly to be merged into the above
|
||||
int iAdapter;
|
||||
|
Reference in New Issue
Block a user