Forum Discussion
EndritP
7 years agoHonored Guest
Creating a hand UI menu to occlude the OVR Avatar controllers
Not sure if this will be helpful to anyone, but I wanted to share the workaround I did to stop the OVRAvatar hands showing through any UI hand menu. I basically wanted to have a togglable UI hand menu as a child of the LeftHandAnchor.
At first I tried to apply a custom shader to the UI components, to try and get them to render over everything - https://answers.unity.com/questions/878667/world-space-canvas-on-top-of-everything.html
This didn't work for whatever reason, and neither did messing around with the sorting Layers.
To fix this I basically went into the following shaders:
OVRAvatar_PC_SingleComponent
AvatarSurfaceShaderPBS
and this script:
OvrAvatarSkinnedMeshRenderPBSV2Component
in the first 2 shaders I changed the RenderQueue to geometry.
In the script I removed this line of code:
mesh.sharedMaterial.renderQueue = OvrAvatarMaterialManager.RENDER_QUEUE;
That bit of code seems to override the renderqueue set by the shader, by setting it to 3640 which I didn't want.
With these changes I could make UI elements appear over the oculus hands + controllers without the hands showing through.
I'd be interested to hear how anyone else solved this problem or if it came up for them.
-E
At first I tried to apply a custom shader to the UI components, to try and get them to render over everything - https://answers.unity.com/questions/878667/world-space-canvas-on-top-of-everything.html
This didn't work for whatever reason, and neither did messing around with the sorting Layers.
To fix this I basically went into the following shaders:
OVRAvatar_PC_SingleComponent
AvatarSurfaceShaderPBS
and this script:
OvrAvatarSkinnedMeshRenderPBSV2Component
in the first 2 shaders I changed the RenderQueue to geometry.
In the script I removed this line of code:
mesh.sharedMaterial.renderQueue = OvrAvatarMaterialManager.RENDER_QUEUE;
That bit of code seems to override the renderqueue set by the shader, by setting it to 3640 which I didn't want.
With these changes I could make UI elements appear over the oculus hands + controllers without the hands showing through.
I'd be interested to hear how anyone else solved this problem or if it came up for them.
-E
Replies have been turned off for this discussion
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 8 months ago
- 3 months ago
- 11 months ago