Material.renderQueue and "z order"

Hi.

I have a very simple scene with 4 meshes on it, which are being drawn using Graphics.DrawMesh(…) in update().

I pass materials to these DrawMesh(…) calls, and I thought I could use Material.renderQueue in order to have the road displayed “above” the grass.

(the materials use the default shader)

It works, but with artefacts: see screenshot.

Whay may I have missed? Thanks!

alt text

Just found out… That it was not as simple as I expected.

In order to have renderQueue working, you have to set ZTest Off in your shader.

So I had to create a new custom shader, and to add this line…

I guess I’ll have to dig deeper into shaders then… :wink: