Skip to content
This repository was archived by the owner on Dec 14, 2025. It is now read-only.

Commit 05cc735

Browse files
committed
First version of the layer.
1 parent d3caeee commit 05cc735

13 files changed

+768
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.vs/*
2+
packages/*
3+
x64/*
4+
*.vcxproj.user

Install-Layer.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
$JsonPath = Join-Path "$PSScriptRoot" "XR_APILAYER_NOVENDOR_fov_modifier.json"
2+
reg ADD "HKLM\Software\Khronos\OpenXR\1\ApiLayers\Implicit" /v $JsonPath /f /t REG_DWORD /d 0

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# FOV modifier OpenXR API Layer
2+
3+
## Setup
4+
5+
1. Create a folder in `%ProgramFiles%`. It's important to make it in `%ProgramFiles%` so that UWP applications can access it! For example: `C:\Program Files\OpenXR-API-Layers`.
6+
7+
2. Place `XR_APILAYER_NOVENDOR_fov_modifier.json`, `XR_APILAYER_NOVENDOR_fov_modifier.dll`, `Install-Layer.ps1` and `Uninstall-Layer.ps1` in the folder created above.
8+
9+
3. Run the script `Install-Layer.ps1` **as Administrator**.
10+
11+
4. Start the OpenXR Developer Tools for Windows Mixed Reality, under the *System Status* tab, scroll down to *API Layers*. A layer named `XR_APILAYER_NOVENDOR_fov_modifier` should be listed.
12+
13+
## Removal
14+
15+
1. Go to the folder where the API layer is installed. For example: `C:\Program Files\OpenXR-API-Layers`.
16+
17+
2. Run the script `Uninstall-Layer.ps1` **as Administrator**.
18+
19+
3. Start the OpenXR Developer Tools for Windows Mixed Reality, under the *System Status* tab, scroll down to *API Layers*. There should be no layer named `XR_APILAYER_NOVENDOR_fov_modifier`.
20+
21+
## App configuration
22+
23+
1. First, retrieve the name that the application passes to OpenXR. In order to do that, run the application while the API layer is enabled.
24+
25+
2. Locate the log file for the layer. It will typically be `%LocalAppData%\XR_APILAYER_NOVENDOR_fov_modifier.log`.
26+
27+
3. In the log file, search for the first line saying "Could not load config for ...":
28+
29+
```
30+
dllHome is "C:\Program Files\OpenXR-API-Layers"
31+
XR_APILAYER_NOVENDOR_fov_modifier layer is active
32+
Could not load config for "FS2020"
33+
Could not load config for "Zouna"
34+
Using FOV for left 1.000 1.000 1.000 1.000 and right 1.000 1.000 1.000
35+
```
36+
37+
4. In the same folder where `XR_APILAYER_NOVENDOR_fov_modifier.json` was copied during setup, create a file named after the application, and with the extension `.cfg`. For example `C:\Program Files\OpenXR-API-Layers\FS2020.cfg`.
38+
39+
In this file, set the factor for each FOV angle that needs to be changed. The factor is equal to the percentage divided by 100. This means that 0.5 is 50%, and 1 is 100%.
40+
41+
```
42+
left.up=0.95
43+
left.down=0.95
44+
left.right=0.9
45+
right.up=0.95
46+
right.down=0.95
47+
right.left=0.9
48+
```
49+
50+
In the example above, `left.left` and `right.right` were left out and will assume their default value of 1 (100%).
51+
52+
5. When running the application, the changes should take affect. Inspect the log file if it needs to be confirmed:
53+
54+
```
55+
dllHome is "C:\Program Files\OpenXR-API-Layers"
56+
XR_APILAYER_NOVENDOR_fov_modifier layer is active
57+
Loading config for "FS2020"
58+
Using FOV for left 0.950 0.950 1.000 0.900 and right 0.950 0.950 0.900 1.000
59+
```

Uninstall-Layer.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
$JsonPath = Join-Path "$PSScriptRoot" "XR_APILAYER_NOVENDOR_fov_modifier.json"
2+
reg DELETE "HKLM\Software\Khronos\OpenXR\1\ApiLayers\Implicit" /v "$JsonPath" /f
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"file_format_version" : "1.0.0",
3+
"api_layer": {
4+
"name": "XR_APILAYER_NOVENDOR_fov_modifier",
5+
"library_path": ".\\XR_APILAYER_NOVENDOR_fov_modifier.dll",
6+
"api_version": "1.0",
7+
"implementation_version": "1",
8+
"description": "OpenXR FOV modifier API layer",
9+
"functions": {
10+
"xrNegotiateLoaderApiLayerInterface": "FOVModifier_xrNegotiateLoaderApiLayerInterface"
11+
},
12+
"disable_environment": "DISABLE_XR_APILAYER_NOVENDOR_FOV_MODIFIER"
13+
}
14+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.31205.134
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "XR_APILAYER_NOVENDOR_fov_modifier", "XR_APILAYER_NOVENDOR_fov_modifier.vcxproj", "{92E50B91-2FA3-48A0-B7F7-E04D7790E15B}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|x64 = Debug|x64
11+
Release|x64 = Release|x64
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{92E50B91-2FA3-48A0-B7F7-E04D7790E15B}.Debug|x64.ActiveCfg = Debug|x64
15+
{92E50B91-2FA3-48A0-B7F7-E04D7790E15B}.Debug|x64.Build.0 = Debug|x64
16+
{92E50B91-2FA3-48A0-B7F7-E04D7790E15B}.Release|x64.ActiveCfg = Release|x64
17+
{92E50B91-2FA3-48A0-B7F7-E04D7790E15B}.Release|x64.Build.0 = Release|x64
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {0B3F51AB-1A6D-4C57-881A-12465ACE4E6A}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.props" Condition="Exists('packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.props')" />
4+
<ItemGroup Label="ProjectConfigurations">
5+
<ProjectConfiguration Include="Debug|x64">
6+
<Configuration>Debug</Configuration>
7+
<Platform>x64</Platform>
8+
</ProjectConfiguration>
9+
<ProjectConfiguration Include="Release|x64">
10+
<Configuration>Release</Configuration>
11+
<Platform>x64</Platform>
12+
</ProjectConfiguration>
13+
</ItemGroup>
14+
<PropertyGroup Label="Globals">
15+
<VCProjectVersion>16.0</VCProjectVersion>
16+
<Keyword>Win32Proj</Keyword>
17+
<ProjectGuid>{92e50b91-2fa3-48a0-b7f7-e04d7790e15b}</ProjectGuid>
18+
<RootNamespace>XRAPILAYERNOVENDORfovmodifier</RootNamespace>
19+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
20+
</PropertyGroup>
21+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
22+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
23+
<ConfigurationType>DynamicLibrary</ConfigurationType>
24+
<UseDebugLibraries>true</UseDebugLibraries>
25+
<PlatformToolset>v142</PlatformToolset>
26+
<CharacterSet>Unicode</CharacterSet>
27+
</PropertyGroup>
28+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
29+
<ConfigurationType>DynamicLibrary</ConfigurationType>
30+
<UseDebugLibraries>false</UseDebugLibraries>
31+
<PlatformToolset>v142</PlatformToolset>
32+
<WholeProgramOptimization>true</WholeProgramOptimization>
33+
<CharacterSet>Unicode</CharacterSet>
34+
</PropertyGroup>
35+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
36+
<ImportGroup Label="ExtensionSettings">
37+
</ImportGroup>
38+
<ImportGroup Label="Shared">
39+
</ImportGroup>
40+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
41+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
42+
</ImportGroup>
43+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
44+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
45+
</ImportGroup>
46+
<PropertyGroup Label="UserMacros" />
47+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
48+
<LinkIncremental>true</LinkIncremental>
49+
<TargetName>$(ProjectName)</TargetName>
50+
</PropertyGroup>
51+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
52+
<LinkIncremental>false</LinkIncremental>
53+
<TargetName>$(ProjectName)</TargetName>
54+
</PropertyGroup>
55+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
56+
<ClCompile>
57+
<WarningLevel>Level3</WarningLevel>
58+
<SDLCheck>true</SDLCheck>
59+
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;XRAPILAYERNOVENDORFOVMODIFIER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
60+
<ConformanceMode>true</ConformanceMode>
61+
<PrecompiledHeader>Use</PrecompiledHeader>
62+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
63+
<LanguageStandard>stdcpp17</LanguageStandard>
64+
</ClCompile>
65+
<Link>
66+
<SubSystem>Windows</SubSystem>
67+
<GenerateDebugInformation>true</GenerateDebugInformation>
68+
<EnableUAC>false</EnableUAC>
69+
</Link>
70+
</ItemDefinitionGroup>
71+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
72+
<ClCompile>
73+
<WarningLevel>Level3</WarningLevel>
74+
<FunctionLevelLinking>true</FunctionLevelLinking>
75+
<IntrinsicFunctions>true</IntrinsicFunctions>
76+
<SDLCheck>true</SDLCheck>
77+
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;XRAPILAYERNOVENDORFOVMODIFIER_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
78+
<ConformanceMode>true</ConformanceMode>
79+
<PrecompiledHeader>Use</PrecompiledHeader>
80+
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
81+
<LanguageStandard>stdcpp17</LanguageStandard>
82+
</ClCompile>
83+
<Link>
84+
<SubSystem>Windows</SubSystem>
85+
<EnableCOMDATFolding>true</EnableCOMDATFolding>
86+
<OptimizeReferences>true</OptimizeReferences>
87+
<GenerateDebugInformation>true</GenerateDebugInformation>
88+
<EnableUAC>false</EnableUAC>
89+
</Link>
90+
</ItemDefinitionGroup>
91+
<ItemGroup>
92+
<ClInclude Include="pch.h" />
93+
</ItemGroup>
94+
<ItemGroup>
95+
<ClCompile Include="dllmain.cpp" />
96+
<ClCompile Include="pch.cpp">
97+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
98+
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
99+
</ClCompile>
100+
</ItemGroup>
101+
<ItemGroup>
102+
<None Include=".gitignore" />
103+
<None Include="Install-Layer.ps1" />
104+
<None Include="packages.config" />
105+
<None Include="README.md" />
106+
<None Include="Uninstall-Layer.ps1" />
107+
<None Include="XR_APILAYER_NOVENDOR_fov_modifier.json" />
108+
</ItemGroup>
109+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
110+
<ImportGroup Label="ExtensionTargets">
111+
<Import Project="packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.targets" Condition="Exists('packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.targets')" />
112+
</ImportGroup>
113+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
114+
<PropertyGroup>
115+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
116+
</PropertyGroup>
117+
<Error Condition="!Exists('packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.props')" Text="$([System.String]::Format('$(ErrorText)', 'packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.props'))" />
118+
<Error Condition="!Exists('packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\OpenXR.Headers.1.0.10.2\build\native\OpenXR.Headers.targets'))" />
119+
</Target>
120+
</Project>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<Filter Include="Source Files">
5+
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+
</Filter>
8+
<Filter Include="Header Files">
9+
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
11+
</Filter>
12+
</ItemGroup>
13+
<ItemGroup>
14+
<ClInclude Include="pch.h">
15+
<Filter>Header Files</Filter>
16+
</ClInclude>
17+
</ItemGroup>
18+
<ItemGroup>
19+
<ClCompile Include="dllmain.cpp">
20+
<Filter>Source Files</Filter>
21+
</ClCompile>
22+
<ClCompile Include="pch.cpp">
23+
<Filter>Source Files</Filter>
24+
</ClCompile>
25+
</ItemGroup>
26+
<ItemGroup>
27+
<None Include="packages.config" />
28+
<None Include="XR_APILAYER_NOVENDOR_fov_modifier.json" />
29+
<None Include=".gitignore" />
30+
<None Include="README.md" />
31+
<None Include="Install-Layer.ps1" />
32+
<None Include="Uninstall-Layer.ps1" />
33+
</ItemGroup>
34+
</Project>

0 commit comments

Comments
 (0)