Skip to content

Commit

Permalink
Expose render resolution directly
Browse files Browse the repository at this point in the history
  • Loading branch information
oneup03 committed Jul 19, 2024
1 parent e3e5be1 commit 5190af4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ Windows-only solution currently, but there are other solutions on Linux like Mon
|---------------------|---------|---------------------------------------------------------------------------------------------|----------------|
| `window_width` | `int` | The width of the application window. | `1920` |
| `window_height` | `int` | The height of the application window. | `1080` |
| `render_width` | `int` | The width to render per eye (can be higher or lower than the application window) | `1920` |
| `render_height` | `int` | The height to render per eye (can be higher or lower than the application window) | `1080` |
| `hmd_height` | `float` | The height of the simulated HMD. | `1.0` |
| `aspect_ratio` | `float` | The aspect ratio used to calculate vertical FoV | `1.77778` |
| `fov` | `float` | The field of view (FoV) for the VR rendering. | `90.0` |
| `depth` | `float` | The max depth. Overrides VR's IPD field. | `0.5` |
| `convergence` | `float` | Where the left and right images converge. Adjusts frustum. | `0.1` |
| `tab_enable` | `bool` | Enable or disable top-and-bottom (TaB) 3D output (Side by Side is default) | `false` |
| `half_enable` | `bool` | Enable or disable half SbS/TaB 3D output. | `true` |
| `reverse_enable` | `bool` | Enable or disable reversed 3D output. | `false` |
| `hdr_enable` | `bool` | Enable or disable HDR. | `false` |
| `depth_gauge` | `bool` | Enable or disable SteamVR IPD depth gauge display. | `false` |
Expand All @@ -54,6 +55,8 @@ Windows-only solution currently, but there are other solutions on Linux like Mon
- Install SteamVR
- Download the [latest release](https://github.com/oneup03/VRto3D/releases/latest) and copy the `vrto3d` folder to your `Steam\steamapps\common\SteamVR\drivers` folder
- Edit the `Steam\steamapps\common\SteamVR\drivers\vrto3d\resources\settings\default.vrsettings` as needed
- Set your window resolution to your full-screen resolution (i.e. 3840x1080 for Full-SbS or 1920x1080 for Half-SbS)
- Set your render resolution per eye to what you want. Can save some performance by reducing this if you're running a half-size 3D
- Run SteamVR at least once to verify that you see a Headset window. This is usually not needed before running games.
- The Headset window must be on your primary 3D display
- Try launching a VR game
Expand Down
15 changes: 2 additions & 13 deletions vrto3d/src/hmd_device_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ MockControllerDeviceDriver::MockControllerDeviceDriver()

display_configuration.window_width = vrs->GetInt32( stereo_display_settings_section, "window_width" );
display_configuration.window_height = vrs->GetInt32( stereo_display_settings_section, "window_height" );
display_configuration.render_width = vrs->GetInt32(stereo_display_settings_section, "render_width");
display_configuration.render_height = vrs->GetInt32(stereo_display_settings_section, "render_height");

display_configuration.hmd_height = vrs->GetFloat(stereo_display_settings_section, "hmd_height");

Expand All @@ -66,7 +68,6 @@ MockControllerDeviceDriver::MockControllerDeviceDriver()
display_configuration.convergence = vrs->GetFloat(stereo_display_settings_section, "convergence");

display_configuration.tab_enable = vrs->GetBool(stereo_display_settings_section, "tab_enable");
display_configuration.half_enable = vrs->GetBool(stereo_display_settings_section, "half_enable");
display_configuration.reverse_enable = vrs->GetBool(stereo_display_settings_section, "reverse_enable");
display_configuration.hdr_enable = vrs->GetBool(stereo_display_settings_section, "hdr_enable");
display_configuration.depth_gauge = vrs->GetBool(stereo_display_settings_section, "depth_gauge");
Expand All @@ -75,18 +76,6 @@ MockControllerDeviceDriver::MockControllerDeviceDriver()
display_configuration.display_frequency = vrs->GetFloat(stereo_display_settings_section, "display_frequency");
display_configuration.sleep_count_max = (int)(floor(1600.0 / (1000.0 / display_configuration.display_frequency)));

int32_t half_width = display_configuration.half_enable ? 1 : 2;
if (display_configuration.tab_enable)
{
display_configuration.render_width = display_configuration.window_width;
display_configuration.render_height = display_configuration.window_height / half_width;
}
else
{
display_configuration.render_width = display_configuration.window_width / half_width;
display_configuration.render_height = display_configuration.window_height;
}

// Controller settings
display_configuration.pitch_enable = vrs->GetBool(stereo_display_settings_section, "pitch_enable");
display_configuration.yaw_enable = vrs->GetBool(stereo_display_settings_section, "yaw_enable");
Expand Down
1 change: 0 additions & 1 deletion vrto3d/src/hmd_device_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ struct StereoDisplayDriverConfiguration
float convergence;

bool tab_enable;
bool half_enable;
bool reverse_enable;
bool hdr_enable;
bool depth_gauge;
Expand Down
3 changes: 2 additions & 1 deletion vrto3d/vrto3d/resources/settings/default.vrsettings
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
"vrto3d_display": {
"window_width": 1920,
"window_height": 1080,
"render_width": 1920,
"render_height": 1080,
"hmd_height": 1.0,
"aspect_ratio": 1.77778,
"fov": 90.0,
"depth": 0.5,
"convergence": 0.1,
"tab_enable": false,
"half_enable": true,
"reverse_enable": false,
"hdr_enable": false,
"depth_gauge": false,
Expand Down

0 comments on commit 5190af4

Please sign in to comment.