Setting Quad rendering mode Transparent pushes it behind canvas

I can’t reproduce the quad from the course. When I create the quad, I attached a new material to apply a color. Then I set the rendering mode of the material from opaque to transparent and it appears to have shifted behind the canvas. I can’t find a way to have the quad in front with the transparent rendering mode. The transform.position.z is in front of the canvas, so it is not related to this.


I also had a problem with the quad color that was really dark. I managed to solve it by playing around with the ambient color in Window | Rendering | Lighting Setting.

I am using unity 2018.3.5f1. What is happening?!

Thanks

Hi same thing is happening with me have you found solution?

All renderer (ie. Sprite Renderer, Mesh Renderer) has a “Sorting Layer” and “Order in Layer” .Sprite Renderer is mostly 2D, so it make sense to have those Layer settings to know which sprite is render infront or behind. Mesh Renderer is used mostly in 3D. With 3D world, Layer settings doesn’t make sense most of the time, since object have a 3rd dimension to move infront or behind another object. 3D object uses Materials instead to know how to render. Unity therefore hides the “Sorting Layer” and “Order in Layer” settings in Inspector. All objects will have its “Sorting Layer” set as Default (which is behind every other Layer).

To expose the “Sorting Layer” and “Order in Layer” settings in Mesh Renderder, you need to customize your Inspector and add it in. Here are some resources:

To expose Layer settings: https://gist.github.com/sinbad/bd0c49bc462289fa1a018ffd70d806e3 <- What I am currently using
Another solution: https://stackoverflow.com/questions/51723465/rendering-3d-objects-behind-2d-objects-unity
A third solution: https://answers.unity.com/questions/1221687/render-mesh-over-sprite.html

For the latest 2019.xx unity, you can just copy one of the script above into any folder, and your Inpsector should change. To undo, just comment out the entire file.
Those scripts above are Custom Editor scripts. To know more about Custom Editor:

Custom Editor tutorial: https://learn.unity.com/tutorial/editor-scripting#
Unity Custom Editor: https://docs.unity3d.com/Manual/editor-CustomEditors.html

Edit:
Also, set your material’s Shader to Unlit/Transparent. This should solve the lighting problem where a material renders grey, since there is no lighting in the scene. Unlit just means “ignore lighting, render my color as is”

1 Like

Privacy & Terms