cancel
Showing results for 
Search instead for 
Did you mean: 

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

BESpectacle
Protege
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.


ii7fzh425h8s.png
5 REPLIES 5

BESpectacle
Protege
No I hadn't, I can try this. Thanks,

BESpectacle
Protege
@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.
h2r0vcj1bn3f.png


BESpectacle
Protege
@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.
h2r0vcj1bn3f.png


Digibix
Expert Protege
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

BESpectacle
Protege

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.