bio998 Posted February 12, 2023 Share Posted February 12, 2023 (edited) I'm trying to implement foveated rendering in my game, but I'm getting the error in the title when using using Wave.OpenXR.Foveation; I'm following the documentation here https://developer.vive.com/resources/openxr/openxr-mobile/tutorials/unity/using-foveation-in-your-app/ I'm using: Unity 2020.3.38f1 VIVE OpenXR Plugin - Android 1.0.4 OpenXR Plugin 1.4.2 In "XR plugin management", I've enabled "OpenXR" with "VIVE Focus 3 Support feature group", and in the OpenXR VIVE Focus 3 Support features, I've enabled 'VIVE Focus 3 Support' and 'VIVE Focus 3 Foveation' I'm not sure what is wrong, but my project did used to have the Wave plugin, which I removed, and I started from scratch using the VIVE OpenXR Plugin. The full error: "Assets\Scripts\PlatformManager\PlatformManagerBen.cs(17,19): error CS0234: The type or namespace name 'Foveation' does not exist in the namespace 'Wave.OpenXR' (are you missing an assembly reference?)" Anyone had the same issue? Can you help? Do I also need the VIVE Wave XR Plugin? I thought not as that is a separate backend.. but elsewhere in the documentation it refers to the VIVE OpenXR Plugin as 'VIVE Wave OpenXR Plugin & Toolkit' which is a bit confusing. Edited February 12, 2023 by bio998 Link to comment Share on other sites More sharing options...
bio998 Posted February 14, 2023 Author Share Posted February 14, 2023 Update: I removed the error by just using: using Wave.OpenXR; instead of using Wave.OpenXR.Foveation; HOWEVER: It doesn't seem to matter what setting I use, I can't detect any foveated rendering actually happening in the build. I have checked that the code is running using a log statement. Anyone know how to get it working? My current full script implementation: using System.Collections; using System.Collections.Generic; using UnityEngine; //using Wave.OpenXR.Foveation; #if VIVE using Wave.OpenXR; #endif public class ViveXR_Functions : MonoBehaviour { #if VIVE //from documentation https://developer.vive.com/resources/openxr/openxr-mobile/tutorials/unity/using-foveation-in-your-app/ [SerializeField] XrFoveationModeHTC UsingMode; void Start() { XrFoveationConfigurationHTC[] Configs = new XrFoveationConfigurationHTC[2]; /////////////////////Setting for left eye///////////////////////////// Configs[0].level = XrFoveationLevelHTC.XR_FOVEATION_LEVEL_HIGH_HTC; // Configs[0].clearFovDegree = 0; // Configs[0].focalCenterOffset.x = 0.0f; // Configs[0].focalCenterOffset.y = 0.0f; // ////////////////////////////////////////////////////////////////////// ////////////////////Setting for right eye///////////////////////////// Configs[1].level = XrFoveationLevelHTC.XR_FOVEATION_LEVEL_HIGH_HTC; // Configs[1].clearFovDegree = 0; // Configs[1].focalCenterOffset.x = 0.0f; // Configs[1].focalCenterOffset.y = 0.0f; // ////////////////////////////////////////////////////////////////////// switch (UsingMode) { //XR_FOVEATION_MODE_FIXED_HTC: The position of foveation is fixed case XrFoveationModeHTC.XR_FOVEATION_MODE_FIXED_HTC: ViveFoveation.ApplyFoveationHTC(XrFoveationModeHTC.XR_FOVEATION_MODE_FIXED_HTC, 0, null); break; //XR_FOVEATION_MODE_DYNAMIC_HTC: the position of foveation can be addjust case XrFoveationModeHTC.XR_FOVEATION_MODE_DYNAMIC_HTC: ViveFoveation.ApplyFoveationHTC(XrFoveationModeHTC.XR_FOVEATION_MODE_DYNAMIC_HTC, 0, null); break; //XR_FOVEATION_MODE_CUSTOM_HTC: the foveation will use the custom setting case XrFoveationModeHTC.XR_FOVEATION_MODE_CUSTOM_HTC: ViveFoveation.ApplyFoveationHTC(UsingMode, 2, Configs); break; case XrFoveationModeHTC.XR_FOVEATION_MODE_MAX_ENUM_HTC: ViveFoveation.ApplyFoveationHTC(XrFoveationModeHTC.XR_FOVEATION_MODE_MAX_ENUM_HTC, 0, null); break; default: Debug.Log("VIVE foveation NOT set"); break; } } #endif } Link to comment Share on other sites More sharing options...
bio998 Posted February 14, 2023 Author Share Posted February 14, 2023 I think I have found the more specific issue. I'm getting the error: Quote DllNotFoundException: waveopenxr Wave.OpenXR.ViveFoveation.ApplyFoveationHTC (Wave.OpenXR.XrFoveationModeHTC mode, System.UInt32 configCount, Wave.OpenXR.XrFoveationConfigurationHTC[] configs, System.UInt64 flags) (at Library/PackageCache/com.htc.upm.wave.openxr@1.0.4/Runtime/Features/Foveation/Scripts/ViveFoveation.cs:69) ViveFunctions.Start () (at Assets/ViveFunctions.cs:42) When using the code above. How can I solve this Dll not found exception? Link to comment Share on other sites More sharing options...
bio998 Posted February 14, 2023 Author Share Posted February 14, 2023 Ok, I've found the solution (I think). I placed XrFoveationConfigurationHTC[] Configs = new XrFoveationConfigurationHTC[2]; outside of the Start() function. After that it just started working... but I'm not sure exactly if this was what did it. I would say though that the documentation should be updated from this: using Wave.OpenXR.Foveation; to this: using Wave.OpenXR; Link to comment Share on other sites More sharing options...
Shirly.H Posted March 16, 2023 Share Posted March 16, 2023 Hi @bio998 Sorry for late reply and thank you for your feedback. The document have been corrected. Please see https://developer.vive.com/resources/openxr/openxr-mobile/tutorials/unity/using-foveation-in-your-app/. Link to comment Share on other sites More sharing options...
SmallStudio Posted June 4, 2023 Share Posted June 4, 2023 @Shirly Hsiao Despite following the document I still don't have foveation active in my Android app (I checked visually and also with the performance HUD). Is there something specific I should be looking for? Also, since we switched to OpenXR we don't have access to adaptative quality, is this normal? it doesn't popup in the API reference documentation too. Thanks! Link to comment Share on other sites More sharing options...
SmallStudio Posted June 4, 2023 Share Posted June 4, 2023 Furthermore, when I play in the editor I get the following error : DllNotFoundException: waveopenxr assembly:<unknown assembly> type:<unknown type> member:(null) Wave.OpenXR.ViveFoveation.ApplyFoveationHTC (Wave.OpenXR.XrFoveationModeHTC mode, System.UInt32 configCount, Wave.OpenXR.XrFoveationConfigurationHTC[] configs, System.UInt64 flags) (at Library/PackageCache/com.htc.upm.wave.openxr@1.0.5/Runtime/Features/Foveation/Scripts/ViveFoveation.cs:71) SetFoveation.Start () (at Assets/02_Scripts/SetFoveation.cs:28) DllNotFoundException: waveopenxr assembly:<unknown assembly> type:<unknown type> member:(null) Wave.OpenXR.ViveFoveation.ApplyFoveationHTC (Wave.OpenXR.XrFoveationModeHTC mode, System.UInt32 configCount, Wave.OpenXR.XrFoveationConfigurationHTC[] configs, System.UInt64 flags) (at Library/PackageCache/com.htc.upm.wave.openxr@1.0.5/Runtime/Features/Foveation/Scripts/ViveFoveation.cs:71) SetFoveation.Start () (at Assets/02_Scripts/SetFoveation.cs:28) I guess it is because there's just the Android so and no corresponding Windows dll? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now