- Home /
How to Render Unity UI Canvas in between two 3D Objects?
I have a world space UI canvas which I want to render on top of some background 3D objects. So far I have achieved it by setting Order in Layer property of canvas to 1. Now the canvas is rendered on top of 3D Objects in background. For fading effect I am using a shader (Unlit Transparent Color) on shpere which is provided by Oculus as:
Shader "Oculus/Unlit Transparent Color"
{
Properties
{
_Color ("Main Color", Color) = (1,1,1,1)
}
SubShader
{
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
LOD 100
Fog {Mode Off}
Cull Off
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
Color [_Color]
Pass {}
}
}
Fader is working fine with everything except the canvas which has Order in Layer = 1. Due to this setting UI always appear on top of everything no matter how close I place the fader sphere to the camera.
Is there any kind of settings which can be used to control rendering of 3D Objects on top of a canvas. Like we have Order in Layer for Sprite Renderer and UI Canvas?
Your answer
Follow this Question
Related Questions
Help! Canvas element cannot be seen in Oculus. (Unity 5.2.3) (C#) 1 Answer
Is there a clipping distance for UI elements? 1 Answer
Display a world-space canvas to overlay all the meshes but not the other UI objects 0 Answers
[VR] How to display a canvas with Oculus 5 Answers
SetPropertyBlock for CanvasRenderer? 1 Answer