Issues with Oculus Avatar on in Unity — Oculus
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.

Issues with Oculus Avatar on in Unity

protected void UpdateSkinnedMesh(OvrAvatar avatar, Transform[] bones, ovrAvatarTransform localTransform, ovrAvatarVisibilityFlags visibilityMask, IntPtr renderPart)
....
////i added this top rule:
       if (blendShapeFailCount<5 && blendParams.blendShapeParamCount > mesh.sharedMesh.blendShapeCount)
        {
            Debug.Log("blendShapeFailCount:"+ blendShapeFailCount);
            blendShapeFailCount++;
        }
        else if(blendShapeFailCount<5){
            for (uint i = 0; i < blendParams.blendShapeParamCount; i++)
            {
                float value = blendParams.blendShapeParams[i];
                mesh.SetBlendShapeWeight((int)i, value * 100.0f);
            }
        }
One of my users haven't set their avatar, and this was throwing non stop out of bounds exceptions into the logs. Seems like a typo, but if i<bones.length, the sub block shouldn't ever be entered. 

I'm on version (v1.37) of oculus integration for unity. (2019.1.2f1)

Array index (1) is out of bounds (size=0)
OvrAvatarRenderComponent:UpdateSkinnedMesh(OvrAvatar, Transform[], ovrAvatarTransform, ovrAvatarVisibilityFlags, IntPtr)
OvrAvatarSkinnedMeshRenderComponent:UpdateSkinnedMeshRender(OvrAvatarComponent, OvrAvatar, IntPtr)
OvrAvatarComponent:UpdateAvatar(ovrAvatarComponent, OvrAvatar)
OvrAvatar:UpdateAvatarComponent(ovrAvatarComponent)
OvrAvatar:UpdateSDKAvatarUnityState()
OvrAvatar:Update()

I have resolved the issue as i mentioned above by having a blendShapeFailCount. 

Also, within
OvrAvatarMaterialManager
.. public void ValidateTextures()
A fresh oculus SDK install in unity for mobile is throwing error from here. We fixed it by adding a return statement immediately the function header. Nothing seems to break when i do that, but avatar doesn't work when I don't. 

Additionally, a handful of fallback textures are empty in OvrAvatarMaterialManager.
Finally, the OVR Avatar component, comes with unassigned shaders. I did my best to guess what belongs, but the result is it looks different than it did before the previous version of oculus SDK. 

...
actually regarding the last thing..looks like it was just an issue with updating from a previous version where these fields weren't assigned. I looked at the sample scenes, and there the avatar had the proper things assigned. 

----

One more thing. It appears that Oculus avatar is producing 1.7kb of GC allocation per frame. 


A lot of it looks like it has to do with Marshalling data from the native side. 

Comments

  • Ross_BeefRoss_Beef Posts: 170 Oculus Staff
    Hey there, @carrotstien
     -- we're looking to address GC, load times and runtime memory allocation in 1.38 and 1.39. Stay tuned!

    I've also escalated your fix to the team. Thanks for flagging.
  • carrotstiencarrotstien Posts: 7
    NerveGear
    awesome, can't wait!
Sign In or Register to comment.