cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with Oculus Avatar on in Unity

carrotstien
Protege
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;
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. 
b4mh6z0fniex.png

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

2 REPLIES 2

Ross_Beef
Heroic Explorer
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.

carrotstien
Protege
awesome, can't wait!