Graphics.CopyTexture Debug Log bloat — 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.

Graphics.CopyTexture Debug Log bloat

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
Tagged:

Comments

  • treeviewstudiostreeviewstudios Posts: 39
    Brain Burst
    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 

  • cloud_canvascloud_canvas Posts: 59
    Hiro Protagonist
    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_canvascloud_canvas Posts: 59
    Hiro Protagonist
    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
  • wsteptoewsteptoe Posts: 1
    NerveGear
    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);
    }
Sign In or Register to comment.