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.

Avatar Hands sorting oddly with transparent objects (TextMeshPro) in Unity.

beppert-clbeppert-cl Posts: 7 Oculus Start Member
Transparent objects that should appear in front of the hands getting clipped. Trying to use TextMeshPro but same issue on any transparent material. Saw it in Unity 5.6.4 have since upgraded to Unity 2017.3.1 same issue. Oculus Utilities/Avatar 1.24. 

Opaque works, Cutout also works but not useable due to harsh edges. The only thing close that works is a shader from SteamVR - Valve/VR/Silhouette (pictured as a circle) but isn't usable as a font shader.


Comments

  • beppert-clbeppert-cl Posts: 7 Oculus Start Member
    edited April 2018
    No I hadn't, I can try this. Thanks,
  • beppert-clbeppert-cl Posts: 7 Oculus Start Member
    @imperativity - I was not able to use the OVROverlay components because it selects a static texture but the TextMeshPro Unity package "texture" is a font atlas and the text is generated in realtime by the shader. Did I miss something?

    I did have success with an alternative solution based on another forum post: https://forums.oculusvr.com/developer/discussion/comment/491844/#Comment_491844

    Copied the TMP_SDF shader from the TextMeshPro package and modified the SubShader section to:

        Tags
        {
            "Queue" = "Geometry+10000"
            "RenderType"="Outline"
            "RenderType" = "Transparent"
        }
            Blend One OneMinusSrcAlpha

    which seems to work for transparent text either in front or behind the Avatar hands.



  • beppert-clbeppert-cl Posts: 7 Oculus Start Member
    @imperativity - I was not able to use the OVROverlay components because it selects a static texture but the TextMeshPro Unity package "texture" is a font atlas and the text is generated in realtime by the shader. Did I miss something?

    I did have success with an alternative solution based on another forum post: https://forums.oculusvr.com/developer/discussion/comment/491844/#Comment_491844

    Copied the TMP_SDF shader from the TextMeshPro package and modified the SubShader section to:

        Tags
        {
            "Queue" = "Geometry+10000"
            "RenderType"="Outline"
            "RenderType" = "Transparent"
        }
            Blend One OneMinusSrcAlpha

    which seems to work for transparent text either in front or behind the Avatar hands.



  • DigibixDigibix Posts: 17 Oculus Start Member
    Try this on the TextmeshPro object:
    • Go to the Textmeshpro script section
    • Click on Extra Settings...(to open the extra options)
    • On the sorting layer row change the order to 10
  • beppert-clbeppert-cl Posts: 7 Oculus Start Member
    digibix said:
    Try this on the TextmeshPro object:
    • Go to the Textmeshpro script section
    • Click on Extra Settings...(to open the extra options)
    • On the sorting layer row change the order to 10

    This worked too, after changing the "Sorting Layer" from "Default" to "MetaCanvas". Thanks @digibix it's a better solution as it doesn't require maintaining a parallel shader for TextMeshPro.
Sign In or Register to comment.