Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

DLL errors & Avatar Editor launch error -> 1.10


Been playing around with Avatars in the Unity editor and all is well. I removed the Asset package and references to the .dll in accordance with the 1.10 update and everything works great. However, when running a .exe build there are errors in the log file due to not being able to find the .dll and as a result the avatars are missing from the build.

Here's a snippet from the logs:

Fallback handler could not load library D:/Projects/UnityProjects/AvatarTest/test2_Data/Mono/libovravatar
Fallback handler could not load library D:/Projects/UnityProjects/AvatarTest/test2_Data/Mono/.\libovravatar
Fallback handler could not load library D:/Projects/UnityProjects/AvatarTest/test2_Data/Mono/libovravatar
Fallback handler could not load library D:/Projects/UnityProjects/AvatarTest/test2_Data/Mono/libovravatar
Fallback handler could not load library D:/Projects/UnityProjects/AvatarTest/test2_Data/Mono/.\libovravatar
Fallback handler could not load library D:/Projects/UnityProjects/AvatarTest/test2_Data/Mono/libovravatar
Fallback handler could not load library D:/Projects/UnityProjectse/AvatarTest/test2_Data/Mono/libovravatar
Fallback handler could not load library D:/Projects/UnityProjects/AvatarTest/test2_Data/Mono/.\libovravatar
Fallback handler could not load library D:/Projects/UnityProjects/AvatarTest/test2_Data/Mono/libovravatar
Fallback handler could not load library D:/Projects/UnityProjects/AvatarTest/test2_Data/Mono/libovravatar
Fallback handler could not load library D:/Projects/UnityProjects/AvatarTest/test2_Data/Mono/.\libovravatar
Fallback handler could not load library D:/Projects/UnityProjects/AvatarTest/test2_Data/Mono/libovravatar
DllNotFoundException: libovravatar
  at (wrapper managed-to-native) Oculus.Avatar.CAPI:ovrAvatar_Initialize (string)
  at OvrAvatarSDKManager.Initialize () [0x00000] in <filename unknown>:0 
  at OvrAvatarSDKManager.get_Instance () [0x00000] in <filename unknown>:0 
  at OvrAvatar.Start () [0x00000] in <filename unknown>:0 
 
(Filename:  Line: -1)

Fallback handler could not load library D:/Projects/UnityProjects/AvatarTest/test2_Data/Mono/libovravatar
Fallback handler could not load library D:/Projects/UnityProjects/AvatarTest/test2_Data/Mono/.\libovravatar
Fallback handler could not load library D:/Projects/UnityProjects/AvatarTest/test2_Data/Mono/libovravatar
NullReferenceException: Object reference not set to an instance of an object
  at OvrAvatarSDKManager.RequestAvatarSpecification (UInt64 userId, .specificationCallback callback) [0x00000] in <filename unknown>:0 
  at OvrAvatar.Start () [0x00000] in <filename unknown>:0 
 
(Filename:  Line: -1)


The other issue I'm having is that I see the Edit Avatar option in Home, but when I go to launch it, I get an error:

Package oculus-avatar-editor (partial) can't launch, invalid state (1971014)

I don't think these two issues are related. The later issue seems like the options in Home haven't rolled out properly (maybe I have permission to see the button but not to launch the editor?)

Comments

  • NoughtceratopsNoughtceratops Posts: 8 Oculus Staff
    Hi! We're looking into the errors with launching the avatar editor now. Thank you for the report.

    As far as the launch errors in built versions, can you please verify that there are no residual versions of libovravatar.dll or OvrAvatarAssets.zip in your Unity project's Plugins directory?

    Also, can you check to see if libovravatar.dll exists in your "Program Files\Oculus\Support\oculus-runtime" directory?

    Thanks!
  • mmcginleymmcginley Posts: 6
    NerveGear
    Yep, project is definitely clear of those 2 files, and they exist in the oculus-runtime directory.

    That being said, I have the runtime installed to E:\Oculus and not C:\Program Files. Not sure if that could cause it?
  • NoughtceratopsNoughtceratops Posts: 8 Oculus Staff
    That should be fine, but can you do me a favor and check your environment variables to see if the oculus-runtime folder is included in your system path? It should've been added by the OculusSetup installer, and should correctly point to E:\Oculus if you installed the runtime there.

    Also, are you building your project as a 64 bit application?
  • mmcginleymmcginley Posts: 6
    NerveGear
    Double checked the Env variables and for some reason there was an old reference in there. I could've sworn I deleted it previously.

    After deletion (and checking that I'm running a 64bit build) I'm finding a different error in the logs. Still no avatar showing up in the build...


    NullReferenceException
      at (wrapper managed-to-native) UnityEngine.Material:Internal_CreateWithShader (UnityEngine.Material,UnityEngine.Shader)
      at UnityEngine.Material..ctor (UnityEngine.Shader shader) [0x00000] in <filename unknown>:0 
      at OvrAvatar.CreateAvatarMaterial (System.String name, Boolean physicallyBasedShader, Boolean selfOccluding) [0x00000] in <filename unknown>:0 
      at OvrAvatar.AddSkinnedMeshRenderComponent (UnityEngine.GameObject gameObject, UInt64 assetID, ovrAvatarVisibilityFlags visibilityMask, Boolean physicallyBasedShader) [0x00000] in <filename unknown>:0 
      at OvrAvatar.AddAvatarComponent (UnityEngine.GameObject componentObject, ovrAvatarComponent component) [0x00000] in <filename unknown>:0 
      at OvrAvatar.UpdateSDKAvatarUnityState () [0x00000] in <filename unknown>:0 
      at OvrAvatar.Update () [0x00000] in <filename unknown>:0 

    Running in editor is still fine.
  • NoughtceratopsNoughtceratops Posts: 8 Oculus Staff
    I think that error is likely caused by the avatar surface shaders not getting picked up by the Unity build system because the mesh parts are now dynamically spawned. I will check to see if we can do anything in the package to make sure they get referenced at build time, but for now you should be able to work around the issue by explicitly referencing the shader assets as preloaded assets in your player settings.

    To do that:
    1. Go to Edit > Project Settings > Player
    2. Expand the “Other Settings” rollout
    3. Find and expand “Preloaded Assets”
    4. Increase the size of the array to have three more slots
    5. Add references the AvatarSurfaceShader* shaders contained in OvrAvatar/Materials
    Like so:


  • mmcginleymmcginley Posts: 6
    NerveGear
    Works perfectly, thanks!
  • phindlephindle Posts: 48
    Brain Burst
    Hi Noughtcertatops.

    I'm having the exact same issues as mmcginley, so I was wondering if these issues will be addressed in an imminent release of the SDK? This problem has just bitten me, so I'd argue that it's a major issue.

    Thanks,

  • phindlephindle Posts: 48
    Brain Burst
    Update on previous post, I am seeing errors & warnings when I build a non-Editor package. I am seeing many errors of the following type:

    I am getting the following errors:
    Shader error in 'OvrAvatar/AvatarSurfaceShader': Invalid const register num: 61. Max allowed is 31. at Assets/OvrAvatar/Content/Materials/AvatarMaterialStateShader.cginc(172) (on d3d11_9x)Compiling Fragment program with DIRECTIONAL LIGHTMAP_OFF DYNAMICLIGHTMAP_OFF PROJECTOR_OFF PARALLAX_OFF LAYERS_8 ROUGHNESS_ON NORMAL_MAP_ON
    Platform defines: UNITY_NO_LINEAR_COLORSPACE UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING SHADER_API_MOBILE

    There are many dozens of such errors, they are not all the same, but the same 'invalid const register num' on different source code lines of AvatarMaterialStateShader.cginc.

    I also see some warnings which have the general form:
    Shader warning in '/OvrAvatar/AvatarSurfaceShader': use of potentially uninitialized variable (ComputeColor) etc
    .I am building Windows 64-bit (in order to fix non-rendering avatars) and DX11 in the Player Settings. All other player settings are default settings to the best of my knowledge.

    Thanks,

Sign In or Register to comment.