mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
Merge pull request #1439 from Armada651/ogl-stereo-3d
OGL: Stereoscopic 3D Support
This commit is contained in:
@ -1123,6 +1123,26 @@ void CFrame::OnKeyDown(wxKeyEvent& event)
|
||||
{
|
||||
State::Load(g_saveSlot);
|
||||
}
|
||||
else if (IsHotkey(event, HK_INCREASE_SEPARATION))
|
||||
{
|
||||
if (++g_Config.iStereoSeparation > 100)
|
||||
g_Config.iStereoSeparation = 100;
|
||||
}
|
||||
else if (IsHotkey(event, HK_DECREASE_SEPARATION))
|
||||
{
|
||||
if (--g_Config.iStereoSeparation < 0)
|
||||
g_Config.iStereoSeparation = 0;
|
||||
}
|
||||
else if (IsHotkey(event, HK_INCREASE_CONVERGENCE))
|
||||
{
|
||||
if (++g_Config.iStereoConvergence > 500)
|
||||
g_Config.iStereoConvergence = 500;
|
||||
}
|
||||
else if (IsHotkey(event, HK_DECREASE_CONVERGENCE))
|
||||
{
|
||||
if (--g_Config.iStereoConvergence < 0)
|
||||
g_Config.iStereoConvergence = 0;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
|
@ -238,6 +238,11 @@ void HotkeyConfigDialog::CreateHotkeyGUIControls()
|
||||
_("Freelook Zoom Out"),
|
||||
_("Freelook Reset"),
|
||||
|
||||
_("Increase Stereocopy Separation"),
|
||||
_("Decrease Stereocopy Separation"),
|
||||
_("Increase Stereocopy Convergence"),
|
||||
_("Decrease Stereocopy Convergence"),
|
||||
|
||||
_("Load State Slot 1"),
|
||||
_("Load State Slot 2"),
|
||||
_("Load State Slot 3"),
|
||||
|
@ -149,6 +149,10 @@ static wxString crop_desc = wxTRANSLATE("Crop the picture from 4:3 to 5:4 or fro
|
||||
static wxString ppshader_desc = wxTRANSLATE("Apply a post-processing effect after finishing a frame.\n\nIf unsure, select (off).");
|
||||
static wxString cache_efb_copies_desc = wxTRANSLATE("Slightly speeds up EFB to RAM copies by sacrificing emulation accuracy.\nSometimes also increases visual quality.\nIf you're experiencing any issues, try raising texture cache accuracy or disable this option.\n\nIf unsure, leave this unchecked.");
|
||||
static wxString shader_errors_desc = wxTRANSLATE("Usually if shader compilation fails, an error message is displayed.\nHowever, one may skip the popups to allow interruption free gameplay by checking this option.\n\nIf unsure, leave this unchecked.");
|
||||
static wxString stereo_3d_desc = wxTRANSLATE("Select the stereoscopic 3D mode, stereoscopy allows you to get a better feeling of depth if you have the necessary hardware.\nSide-by-Side and Top-and-Bottom are used by most 3D TVs.\nAnaglyph is used for Red-Cyan colored glasses.\nHeavily decreases emulation speed and sometimes causes issues.\n\nIf unsure, select Off.");
|
||||
static wxString stereo_separation_desc = wxTRANSLATE("Control the separation distance, this is the distance between the virtual cameras.\nA higher value creates a stronger feeling of depth while a lower value is more comfortable.");
|
||||
static wxString stereo_convergence_desc = wxTRANSLATE("Control the convergence distance, this controls the apparant distance of virtual objects.\nA higher value creates stronger out-of-screen effects while a lower value is more comfortable.");
|
||||
static wxString stereo_swap_desc = wxTRANSLATE("Swap the left and right eye, mostly useful if you want to view side-by-side cross-eyed.\n\nIf unsure, leave this unchecked.");
|
||||
|
||||
|
||||
#if !defined(__APPLE__)
|
||||
@ -396,7 +400,7 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
|
||||
if (vconfig.backend_info.PPShaders.size())
|
||||
{
|
||||
wxFlexGridSizer* const szr_pp = new wxFlexGridSizer(3, 5, 5);
|
||||
wxChoice *const choice_ppshader = new wxChoice(page_enh, -1);
|
||||
choice_ppshader = new wxChoice(page_enh, -1);
|
||||
RegisterControl(choice_ppshader, wxGetTranslation(ppshader_desc));
|
||||
choice_ppshader->AppendString(_("(off)"));
|
||||
|
||||
@ -425,6 +429,11 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
|
||||
szr_pp->Add(button_config_pp);
|
||||
szr_enh->Add(szr_pp);
|
||||
}
|
||||
else
|
||||
{
|
||||
choice_ppshader = nullptr;
|
||||
button_config_pp = nullptr;
|
||||
}
|
||||
|
||||
// Scaled copy, PL, Bilinear filter
|
||||
szr_enh->Add(CreateCheckBox(page_enh, _("Scaled EFB Copy"), wxGetTranslation(scaled_efb_copy_desc), vconfig.bCopyEFBScaled));
|
||||
@ -438,6 +447,36 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
|
||||
group_enh->Add(szr_enh, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
|
||||
szr_enh_main->Add(group_enh, 0, wxEXPAND | wxALL, 5);
|
||||
|
||||
// - stereoscopy
|
||||
|
||||
if (vconfig.backend_info.bSupportsStereoscopy && vconfig.iStereoMode > 0)
|
||||
{
|
||||
wxFlexGridSizer* const szr_stereo = new wxFlexGridSizer(2, 5, 5);
|
||||
|
||||
const wxString stereo_choices[] = { "Off", "Side-by-Side", "Top-and-Bottom", "Anaglyph" };
|
||||
szr_stereo->Add(new wxStaticText(page_enh, -1, _("Stereoscopic 3D Mode:")), 1, wxALIGN_CENTER_VERTICAL, 0);
|
||||
szr_stereo->Add(CreateChoice(page_enh, vconfig.iStereoMode, wxGetTranslation(stereo_3d_desc), 4, stereo_choices));
|
||||
|
||||
wxSlider* const sep_slider = new wxSlider(page_enh, wxID_ANY, vconfig.iStereoSeparation, 0, 100, wxDefaultPosition, wxDefaultSize);
|
||||
sep_slider->Bind(wxEVT_SLIDER, &VideoConfigDiag::Event_StereoSep, this);
|
||||
RegisterControl(sep_slider, wxGetTranslation(stereo_separation_desc));
|
||||
|
||||
szr_stereo->Add(new wxStaticText(page_enh, wxID_ANY, _("Separation:")), 1, wxALIGN_CENTER_VERTICAL, 0);
|
||||
szr_stereo->Add(sep_slider, 0, wxEXPAND | wxRIGHT);
|
||||
|
||||
wxSlider* const conv_slider = new wxSlider(page_enh, wxID_ANY, vconfig.iStereoConvergence, 0, 500, wxDefaultPosition, wxDefaultSize);
|
||||
conv_slider->Bind(wxEVT_SLIDER, &VideoConfigDiag::Event_StereoFoc, this);
|
||||
RegisterControl(conv_slider, wxGetTranslation(stereo_convergence_desc));
|
||||
|
||||
szr_stereo->Add(new wxStaticText(page_enh, wxID_ANY, _("Convergence:")), 1, wxALIGN_CENTER_VERTICAL, 0);
|
||||
szr_stereo->Add(conv_slider, 0, wxEXPAND | wxRIGHT);
|
||||
|
||||
szr_stereo->Add(CreateCheckBox(page_enh, _("Swap Eyes"), wxGetTranslation(stereo_swap_desc), vconfig.bStereoSwapEyes));
|
||||
|
||||
wxStaticBoxSizer* const group_stereo = new wxStaticBoxSizer(wxVERTICAL, page_enh, _("Stereoscopy"));
|
||||
group_stereo->Add(szr_stereo, 1, wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM, 5);
|
||||
szr_enh_main->Add(group_stereo, 0, wxEXPAND | wxALL, 5);
|
||||
}
|
||||
|
||||
szr_enh_main->AddStretchSpacer();
|
||||
CreateDescriptionArea(page_enh, szr_enh_main);
|
||||
|
@ -165,6 +165,20 @@ protected:
|
||||
ev.Skip();
|
||||
}
|
||||
|
||||
void Event_StereoSep(wxCommandEvent &ev)
|
||||
{
|
||||
vconfig.iStereoSeparation = ev.GetInt();
|
||||
|
||||
ev.Skip();
|
||||
}
|
||||
|
||||
void Event_StereoFoc(wxCommandEvent &ev)
|
||||
{
|
||||
vconfig.iStereoConvergence = ev.GetInt();
|
||||
|
||||
ev.Skip();
|
||||
}
|
||||
|
||||
void Event_ClickClose(wxCommandEvent&);
|
||||
void Event_Close(wxCloseEvent&);
|
||||
|
||||
@ -184,6 +198,12 @@ protected:
|
||||
virtual_xfb->Enable(vconfig.bUseXFB);
|
||||
real_xfb->Enable(vconfig.bUseXFB);
|
||||
|
||||
// PP Shaders
|
||||
if (choice_ppshader)
|
||||
choice_ppshader->Enable(vconfig.iStereoMode != STEREO_ANAGLYPH);
|
||||
if (button_config_pp)
|
||||
button_config_pp->Enable(vconfig.iStereoMode != STEREO_ANAGLYPH);
|
||||
|
||||
// Things which shouldn't be changed during emulation
|
||||
if (Core::IsRunning())
|
||||
{
|
||||
@ -248,6 +268,8 @@ protected:
|
||||
|
||||
wxCheckBox* progressive_scan_checkbox;
|
||||
|
||||
wxChoice* choice_ppshader;
|
||||
|
||||
std::map<wxWindow*, wxString> ctrl_descs; // maps setting controls to their descriptions
|
||||
std::map<wxWindow*, wxStaticText*> desc_texts; // maps dialog tabs (which are the parents of the setting controls) to their description text objects
|
||||
|
||||
|
Reference in New Issue
Block a user