- Home /
Custom Render Queue
I am having problems getting the render order of my materials correct using the 'Custom Render Queue' values in the materials. I have a material that uses a depth mask shader so I want that to render before my other materials, so I set the Custom Render Queue value on the depth mask material to 2001, I then set all my other materials to 2010 so they should render after any object using the depth mask material, but that doesn't happen, there is no change in the render order. If I set the materials to have a queue value of 2500 then the order does change and I get the right result from the depth mask, but now my other materials have been moved into the Alpha test bracket so get no shadows etc. Is there a problem with the render queue values or am I missing some thing obvious here. I can't seem to find any docs on using this other than the shader "queue" tag.
Another point is if I add scripts to my objects to set the renderqueue value directly then it seems to work as expected but I dont want to add that script to every single object in my scene when I thought Custom Render Queue would allow me to get the same result. Can anyone shed any light on this? Mike