cancel
Showing results for 
Search instead for 
Did you mean: 

Graphics.CopyTexture Debug Log bloat

cloud_canvas
Expert Protege
Hi guys,
This issue has been talked about in a disconnected fashion in several places (including the community forum) but never explicitly here in its own thread. To review, whenever an instance of an OvrAvatar is spawned in any scene, in any context, it spams the Unity log with what looks to be about 100 instances of this message:
Graphics.CopyTexture with a region will not copy readable texture data for compressed formats (source texture format 50)

As mentioned in one of the previously linked threads, where this error is coming from has already been tracked down: It's in OvrAvatarMaterialManager.cs, lines 185-191 of ProcessTexturesWithMips(). The only way to suppress the bloat is to comment out the entire TextureCopyManager.CopyTexture() call, which will make every part of the avatar except the hands invisible. I can't speak for other people's experiences, but if I'm taking the content of the message literally, it seems that it's mad about copying a mip for a texture to ASTC since I'm developing for the Go.

Again, this is a linear issue: every time a new Avatar is added, you get another firehose of ~100 error messages. When spawning Avatars is happening in the context of the initialization of a multiplayer session (and why wouldn't it be, in this case?), you get ~100x however many Avatars you're spawning in. So, in my workflow, it makes picking up on certain other things that I'm trying to debug in logcat at the same time impossible. Most of the time, the buffer on my CLI shell is totally full and I can't see anything that happened before I got a blast of CopyTexture warnings.

In general the Avatar SDK needs a lot of love on the mobile side, as it's very expensive and inefficient with the marshaling from the CAPI and really seems to have just been a quick proof-of-concept on making the Oculus Home/full PC SDK "work" on mobile. But at the very least, can you look into this issue and patch it in an upcoming release? It's very, very annoying to have to deal with.

Thanks

Samsung Galaxy S8 (Snapdragon 835), Gear VR (2017), Oculus Go (64GB), Unity 2018.3.14f1
4 REPLIES 4

treeviewstudios
Protege
Disable mobile textures and combine meshes  works, also this was fixed on 2018.3 (release notes say that, havent tested).
this is my OvrAvatar.cs class (modified a couple of bools an changed loading assets callback to public)
https://pastebin.com/mBFHDMdK

I think when its combining meshes it just breaks,

Also i set every texture avatar related to k4tcaex5rnhx.png

cloud_canvas
Expert Protege
It isn't fixed by the upgrade to 2018.3.
Samsung Galaxy S8 (Snapdragon 835), Gear VR (2017), Oculus Go (64GB), Unity 2018.3.14f1

cloud_canvas
Expert Protege
Thanks for your workaround though @treeviewstudios , I tried it and that also worked with the additional bonus of not making the Avatars invisible like my fix does. We're already making quite a few revisions to OvrAvatar.cs internally, so really I'm just waiting on Oculus to address this themselves.
Samsung Galaxy S8 (Snapdragon 835), Gear VR (2017), Oculus Go (64GB), Unity 2018.3.14f1

wsteptoe
Honored Guest
This will be fixed in an upcoming release. In the meantime, if you would like to patch this locally then you can replace the two CopyTexture functions in OvrAvatarTextureCopyManager.cs starting line 94 as follows: 

IEnumerator CopyTextureCoroutine(CopyTextureParams copyTextureParams)
{
    // Wait until frame rendering is done
    yield return new WaitForEndOfFrame();
    Graphics.CopyTexture( copyTextureParams.Src, 0, copyTextureParams.Mip, copyTextureParams.Dst, copyTextureParams.DstElement, copyTextureParams.Mip);
}

private void CopyTexture(CopyTextureParams copyTextureParams)
{
    Graphics.CopyTexture( copyTextureParams.Src, 0, copyTextureParams.Mip, copyTextureParams.Dst, copyTextureParams.DstElement, copyTextureParams.Mip);
}