Material custom render queue resets by itself in the editor.

In the inspector, you can set a render queue for a material when in “Debug” view of the inspector window.

The problem occurs when switching back to “Normal” view, the render queue is reset to 3000.

I proved this in a script. I set the render queue to 3003, then ran the game in the editor. I got the material render queue

Update()
{
  MeshRenderer mr = debugItem.GetComponent<MeshRenderer>();
  Material mat = mr.material;
  int renQ = mat.renderQueue;
  Debug.Log(renQ);
}

It continuously prints “3003”.
As soon as I switch to “Normal view”, it starts printing “3000” to the console, meaning Unity reset the render queue back to 3000.

I don’t what else I have to do to prove this issue exists.

It’s happening with Unity 2017.1. And it also happened for previous versions of Unity.
I fail to see what it is I’m doing wrong here.

Unity implemented a custom material editor for their Standard Shader, that automatically configures the render queue depending on its “Rendering Mode” for example.

The custom material editor is writing to the materials’ renderQueue property every time the material displayed in the Inspector.

I believe there isn’t much you can do. You could download the Material editor source code and change it to your needs. It’s available in the Built in Shaders package (Editor/StandardShaderGUI.cs).

You might want to submit a bug-report letting Unity know that the “Render Queue” is exposed for every shader but the Standard Shader. I believe UT made the “Render Queue” setting available in materials in 5.6, perhaps they just forgot to update their StandardShader material editor to reflect those changes.

I am having the same problem, which their Standard shader when set to Fade will render objects in the wronge order(with object in front behind). using unity 2018.2.3f1.

1 Like

How to enter inspector mode? ctrl + 3 does nothing. Is it limited only to paid version of unity?

You are in inspector mode in default.

I had the same problem in Unity 2023.3 + Shader Graph. For me it’s fixed after adding

property _QueueControl=0 to the shader.