Sorting (rendering) order of materials in mesh renderer

My mesh renderer has several materials on it. They are all using the same triangle, and I need to set their rendering order inside the script. How do I do this? If I can’t, is there way to force the rendering order in the shader code?

change the renderqueue value on each material. careful these are not used on other objects though