Version: Unity 6.3 Beta (6000.3)
LanguageEnglish
  • C#

RenderQueue.Geometry

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Geometry is a predefined render queue that Unity uses for opaque geometry.

This render queue is the default that Unity uses to render all opaque materials. The Geometry render queue has a default value of 2000. You can change this value using the Material.renderQueue or Shader.renderQueue APIs.

You can apply an offset to the default value. This offset must have a value between -500 and +500 to be considered opaque by Unity. Values outside this range fall back into other RenderQueue categories like RenderQueue.Background.

Additional resources: Material.renderQueue, Shader.renderQueue, subshader tags.

using UnityEngine;
using UnityEngine.Rendering;

public class RenderQueueExample : MonoBehaviour { public Material material; public int renderQueueOffset;

void Start() { if (material != null) { // Adjust the render queue using the specified offset material.renderQueue = (int)(RenderQueue.Geometry + renderQueueOffset); } } }

Assigns a custom render queue to a material, to force the sorting of objects rendered with this material.