Skip to content

Commit

Permalink
Add Reverse Eye rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
oneup03 committed Jun 11, 2024
1 parent 5246550 commit 0276a60
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 13 deletions.
1 change: 1 addition & 0 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
env:
SOLUTION_FILE_PATH: .
BUILD_CONFIGURATION: Release
STEAM_PATH: temp

jobs:
Win64:
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ Windows-only solution, but there are other solutions on Linux like MonadoVR.
| `window_height` | `int` | The height of the application window. | `1080` |
| `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` |
| `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` | Flip Left and Right eyes. | `false` |
| `ss_enable` | `bool` | Enable or disable supersampling. | `false` |
| `hdr_enable` | `bool` | Enable or disable HDR rendering. | `false` |
| `ss_scale` | `float` | The supersampling scale factor. | `1.0` |
Expand Down Expand Up @@ -58,6 +59,7 @@ Windows-only solution, but there are other solutions on Linux like MonadoVR.
## Building

- Clone the code and initialize submodules
- Define `STEAM_PATH` environment variable with the path to your main Steam folder
- Open Solution in Visual Studio 2022
- Use the solution to build this driver
- Copy from the `output` folder to the `SteamVR` folder
5 changes: 5 additions & 0 deletions vrto3d/src/hmd_device_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ MockControllerDeviceDriver::MockControllerDeviceDriver()

display_configuration.tab_enable = vr::VRSettings()->GetBool(stereo_display_settings_section, "tab_enable");
display_configuration.half_enable = vr::VRSettings()->GetBool(stereo_display_settings_section, "half_enable");
display_configuration.reverse_enable = vr::VRSettings()->GetBool(stereo_display_settings_section, "reverse_enable");
display_configuration.ss_enable = vr::VRSettings()->GetBool(stereo_display_settings_section, "ss_enable");
display_configuration.hdr_enable = vr::VRSettings()->GetBool(stereo_display_settings_section, "hdr_enable");

Expand Down Expand Up @@ -333,6 +334,10 @@ void StereoDisplayComponent::GetRecommendedRenderTargetSize( uint32_t *pnWidth,
//-----------------------------------------------------------------------------
void StereoDisplayComponent::GetEyeOutputViewport( vr::EVREye eEye, uint32_t *pnX, uint32_t *pnY, uint32_t *pnWidth, uint32_t *pnHeight )
{
if (config_.reverse_enable)
{
eEye = static_cast<vr::EVREye>(!static_cast<bool> (eEye));
}
// Use Top and Bottom Rendering
if (config_.tab_enable)
{
Expand Down
1 change: 1 addition & 0 deletions vrto3d/src/hmd_device_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ struct StereoDisplayDriverConfiguration

bool tab_enable;
bool half_enable;
bool reverse_enable;
bool ss_enable;
bool hdr_enable;

Expand Down
28 changes: 16 additions & 12 deletions vrto3d/vrto3d.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@
<AdditionalDependencies>openvr_api.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>XCOPY "$(ProjectDir)$(ProjectName)" "$(SolutionDir)output\drivers\$(ProjectName)" /S /Y /I</Command>
<Command>XCOPY "$(ProjectDir)$(ProjectName)" "$(STEAM_PATH)\steamapps\common\SteamVR\drivers\$(ProjectName)" /S /Y /I</Command>
<Command>XCOPY "$(SolutionDir)output\drivers\$(ProjectName)\bin" "$(STEAM_PATH)\steamapps\common\SteamVR\drivers\$(ProjectName)\bin" /S /Y /I</Command>
<Command>
XCOPY "$(ProjectDir)$(ProjectName)" "$(SolutionDir)output\drivers\$(ProjectName)" /S /Y /I
XCOPY "$(SolutionDir)output\drivers\" "$(STEAM_PATH)\steamapps\common\SteamVR\drivers\" /S /Y /I
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand All @@ -131,9 +132,10 @@
<AdditionalDependencies>openvr_api.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PostBuildEvent>
<Command>XCOPY "$(ProjectDir)$(ProjectName)" "$(SolutionDir)output\drivers\$(ProjectName)" /S /Y /I</Command>
<Command>XCOPY "$(ProjectDir)$(ProjectName)" "$(STEAM_PATH)\steamapps\common\SteamVR\drivers\$(ProjectName)" /S /Y /I</Command>
<Command>XCOPY "$(SolutionDir)output\drivers\$(ProjectName)\bin" "$(STEAM_PATH)\steamapps\common\SteamVR\drivers\$(ProjectName)\bin" /S /Y /I</Command>
<Command>
XCOPY "$(ProjectDir)$(ProjectName)" "$(SolutionDir)output\drivers\$(ProjectName)" /S /Y /I
XCOPY "$(SolutionDir)output\drivers\" "$(STEAM_PATH)\steamapps\common\SteamVR\drivers\" /S /Y /I
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
Expand All @@ -151,9 +153,10 @@
<AdditionalLibraryDirectories>..\external\openvr\lib\win$(PlatformArchitecture)</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent>
<Command>XCOPY "$(ProjectDir)$(ProjectName)" "$(SolutionDir)output\drivers\$(ProjectName)" /S /Y /I</Command>
<Command>XCOPY "$(ProjectDir)$(ProjectName)" "$(STEAM_PATH)\steamapps\common\SteamVR\drivers\$(ProjectName)" /S /Y /I</Command>
<Command>XCOPY "$(SolutionDir)output\drivers\$(ProjectName)\bin" "$(STEAM_PATH)\steamapps\common\SteamVR\drivers\$(ProjectName)\bin" /S /Y /I</Command>
<Command>
XCOPY "$(ProjectDir)$(ProjectName)" "$(SolutionDir)output\drivers\$(ProjectName)" /S /Y /I
XCOPY "$(SolutionDir)output\drivers\" "$(STEAM_PATH)\steamapps\common\SteamVR\drivers\" /S /Y /I
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand All @@ -175,9 +178,10 @@
<AdditionalLibraryDirectories>..\external\openvr\lib\win$(PlatformArchitecture)</AdditionalLibraryDirectories>
</Link>
<PostBuildEvent>
<Command>XCOPY "$(ProjectDir)$(ProjectName)" "$(SolutionDir)output\drivers\$(ProjectName)" /S /Y /I</Command>
<Command>XCOPY "$(ProjectDir)$(ProjectName)" "$(STEAM_PATH)\steamapps\common\SteamVR\drivers\$(ProjectName)" /S /Y /I</Command>
<Command>XCOPY "$(SolutionDir)output\drivers\$(ProjectName)\bin" "$(STEAM_PATH)\steamapps\common\SteamVR\drivers\$(ProjectName)\bin" /S /Y /I</Command>
<Command>
XCOPY "$(ProjectDir)$(ProjectName)" "$(SolutionDir)output\drivers\$(ProjectName)" /S /Y /I
XCOPY "$(SolutionDir)output\drivers\" "$(STEAM_PATH)\steamapps\common\SteamVR\drivers\" /S /Y /I
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions vrto3d/vrto3d/resources/settings/default.vrsettings
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"convergence": 0.1,
"tab_enable": false,
"half_enable": true,
"reverse_enable": false,
"ss_enable": false,
"hdr_enable": false,
"ss_scale": 1.0,
Expand Down

0 comments on commit 0276a60

Please sign in to comment.