Geometry
Geometry is a predefined render queue that Unity uses for opaque geometry.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Field
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
Geometry = 2000
Remarks
This render queue is the default that Unity uses to render all opaque materials. The render queue has a default value of 2000. You can change this value using the Material.renderQueue or Shader.renderQueue APIs.
GeometryYou 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.
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.