Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UI for per-game stereoscopy settings. #1813

Merged
merged 2 commits into from Jan 12, 2015

Conversation

CrossVR
Copy link
Contributor

@CrossVR CrossVR commented Jan 2, 2015

A convergence base value makes more sense for the convergence value. Zelda: Wind Waker will be the first game with a minimum convergence, the value of 115 is added to the default of 20 which will cause the defaults to converge on Link in-game.

The default convergence value for Zelda: Wind Waker is now the same as used in the preview video.

@CrossVR CrossVR force-pushed the convergence branch 3 times, most recently from 0a1c6bb to ee63c5e Compare January 2, 2015 14:53
@CrossVR
Copy link
Contributor Author

CrossVR commented Jan 2, 2015

I took the liberty to also add these options to the ISO properties to fix issue 8050.

@Linktothepast
Copy link
Contributor

@Armada651 Could you provide the relevant gameini settings syntax to include in https://forums.dolphin-emu.org/Thread-unofficial-howto-using-gameini-settings-per-game after this pr gets merged? Thnx.

@CrossVR CrossVR changed the title VideoConfig: Define a per-game minimum convergence value. Per-game stereoscopy settings. Jan 2, 2015
@CrossVR CrossVR changed the title Per-game stereoscopy settings. Add UI for per-game stereoscopy settings. Jan 2, 2015
@CrossVR
Copy link
Contributor Author

CrossVR commented Jan 2, 2015

@Linktothepast These are the per-game stereoscopy ini settings:

[Video_Stereoscopy]
StereoDepthPercentage = 100 (Percentage of depth value set in the video configuration applied in-game.)
StereoConvergenceMinimum = 0 (Base convergence value that's added to the value set in the video configuration.)
StereoEFBMonoDepth = False (or True to enable "Monoscopic Shadows" respectively.)

The other stereoscopy options that are available in the graphics configuration can also be set per-game:

[Video_Enhancements]
StereoMode = 0 (0 = Off, 1 = Side-by-Side, 2 = Top-and-Bottom, 3 = Anaglyph, 4 = Nvidia 3D Vision (D3D only).)
StereoDepth = 20 (1/10th percentage of window width used to separate the virtual cameras.)
StereoConvergence = 20 (Distance of the convergence plane.)
StereoSwapEyes = False (or True to enable "Swap Eyes" respectively.)

@Linktothepast
Copy link
Contributor

Ok thnx, i will add them after this pr gets merged.

@CarlKenner
Copy link
Contributor

In Dolphin VR, I already have per game settings that specify the number of game units per real world metre for each game. I don't know if that is of any use to you?

And in Dolphin VR most shadows are now perfect, because I have code for classifying what a Viewport is used for, including detecting Render To Texture viewports (square viewports with a size divisible by 8, in a corner of the screen, and some other special cases). For Render To Texture viewports, I set the projection matrices and viewport to exactly what the game asked for (without any head tracking, freelook, widescreen fix, etc), and set the stereoscopic parameters to zero.

BTW, I'm also detecting things like offscreen viewports, split-screen multiplayer viewports (they can choose which player the Rift is displaying, HUD element viewports, letterboxing viewports, fullscreen viewports, and skybox viewports. For skyboxes I render at infinite stereoscopic depth and don't apply freelook.

I really think that is the way to go rather than making all EFB copies mono.

EDIT: BTW, I really don't like you renaming "separation" as "depth". If I see the word depth, I would guess they mean convergence. "separation" is the correct term.

@CrossVR
Copy link
Contributor Author

CrossVR commented Jan 10, 2015

@CarlKenner Unfortunately that's not useful for Convergence, since it depends on the characteristics of the game and not its scale. It's not a problem you have to deal with: For VR the convergence is always zero, since you're not simulating a window into a virtual world instead you're simulating the player standing in the virtual world.

On the other hand, for Depth it would be useful since it depends on the scale. But for that value to be useful we'd need an actual IPD defined in meters. However we can't implement such an IPD since we don't know the pixel density of the monitor being used.

The solutions you're proposing are heuristics. While I don't like relying on those, if we want to solve those issues we'll probably have to bite the bullet and implement them. But I'd like to wait until the 3D feature is more mature before we merge in heuristics.

You may also be interested in the OSVR SDK which will be an open-source VR SDK with Oculus Rift compatibility that won't conflict with our license once we switch to GPLv2+.

About the rename, it was done to be consistent with Nvidia 3D Vision and to avoid people confusing that value with an actual IPD. As explained above we can't implement an IPD without knowing the pixel density of the monitor.

@CarlKenner
Copy link
Contributor

You can (usually) get the pixel density of the monitor from the EDID, if you want it. But Stereoscopic 3D on screens is more an art form than a science, so people will want to choose their own settings for both separation and convergence.

The other thing I'm using Units Per Metre for is making freelook move you at a consistent speed in every game.

Heuristics are necessary because Wii and GameCube games aren't designed for stereoscopic 3D. Some things the game does have a consistent obvious stereoscopic interpretation, but other times we have to make an educated guess what the game is trying to do.

I've never seen a game use a square viewport in the corner for its main rendering of the world, and it is extremely unlikely that any game ever would do that. Some games might use a square viewport for something other than projection shadows, but in those cases stereoscopy (or freelook) are still almost certain to look wrong, and monoscopy would look OK.

It will be good to support OSVR and merge it into Dolphin. I've been slowly moving the Oculus SDK dependent stuff into its own file, so it will be easier to replace with some other VR device or interface. Although I still maintain that GPL does allow open source games to run on closed platforms. And Australian law allows me to fix any software I have a license for to make it support the hardware I want to use it with, regardless of what the license says or whether I even have the source code. And if we are going to be technical about licenses... does GPL even allow running closed games on open-source platforms? I'm pretty sure Metroid Prime isn't GPL compatible.

Doesn't Nvidia 3D Vision hide convergence though? And use the same depth wheel for both separation and convergence?

@CrossVR
Copy link
Contributor Author

CrossVR commented Jan 11, 2015

I haven't researched it myself yet, but I was told monitors would often report incorrect pixel densities in the EDID. I may make an attempt at it sometime, it's better to at least attempt to calculate the separation value based on the monitor characteristics even if they're not always correct. Ofcourse, you'll still be able to adjust it since not everyone has the same IPD.

Pretty sure GPL does allow that or else everyone running Steam on Linux would violate the GPL. However Oculus SDK is a library and GPL specifically forbids linking to non-free libraries that do not fall under the system library exception.

Nvidia 3D Vision does hide the convergence, but that's probably because they have an extensive database of game profiles.

@CarlKenner
Copy link
Contributor

As it's clearly a system library, there is no problem.

@CrossVR
Copy link
Contributor Author

CrossVR commented Jan 11, 2015

The Oculus SDK is not part of the Operating System, thus it is not a system library. The GPL license is very clear about this.

degasus added a commit that referenced this pull request Jan 12, 2015
Add UI for per-game stereoscopy settings.
@degasus degasus merged commit 980ce44 into dolphin-emu:master Jan 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants