Rendering Queues in Unity

Render Queues used to control drawing orders of objects, Source: kie

A lot of times, we need to render certain objects(Player, Gem …etc) to the front even there is an object overlaying our main object.

Controlling the drawing order of objects in Unity can be achieved using Rendering queues.

Rendering Queue is a way of specifying which objects to render first by using tags assigned to the shader.

Unity has 5 default Rendering Queue tags:

1.Background (1000)

2.Geometry (2000)

3.Alpha test (2450)

4.Transparent (3000)

5.Overlay (4000)

You can assign the rendering queue tag to the shader by including this line in the shader or specifying it in the inspector.

You can have a specific value for your tag by setting it in the shader

Render queue value should be in [0..5000] range to work properly, or -1 to use the render queue from the shader.



Software Engineer @ MobiledgeX

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store