Jump to content

The namespace 'Foveation' does not exist in the namespace 'Wave.OpenXR'


bio998

Recommended Posts

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 by bio998
Link to comment
Share on other sites

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

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

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

  • 1 month later...
  • 2 months later...

@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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...