Vertex/Fragment shaders - transparency ignoring Render Queue

So, I’ve been writing my own fur shader (because I have only seen one half-decent one around, and I don’t have the money to buy it), and it’s been going pretty well so far. Lighting is a bit dodgy, but only because I don’t have Unity Pro (I could fix it with that, I think). I’m happy to use it as it is at the moment, except for one thing. This shader works by rendering a solid base layer, then gradually stepping out the vertices, and rendering 10 fur layers, stacking on top of each other to produce the hairs. The first layer is rendered with ZWrite On, as well as being tagged as Opaque. The fur layers, however, are rendered with ZWrite Off, and are tagged as Transparent (with the appropriate render queue). However, this is producing problems, as for some reason they seem to always render behind my trees’ leaves. No matter what I do to the render queue, I can’t seem to get this to work - instead, the only thing I can do is to turn on ZWrite, and this just culls out the leaves, which is almost as bad. I’m fairly new to fragment shaders (I’ve mostly worked with surface shaders before now), so if anyone could help me out here, I’d really appreciate it. Here’s a screenshot of the effect:

[15904-fur+issue.png|15904]

I hope that someone can help me out!

I’m no shader expert and I can’t see your code, but I think “Transparent” should be fine. Another thing to consider is the Blend options, which are typically right below the tags.

Try:

Tags{ “Queue”, “Transparent” }

ZWrite Off

Blend SrcAlpha OneMinusSrcAlpha

This is Alpha blending.

Aha! I fixed it! It turns out I needed the tags in the Subshader, rather than inside the Pass. The first pass (the base pass) now overwrites the tags from the Subshader, but the rest of the passes, the fur layers, use the default, and now it works perfectly.

Would you be willing to share that shader? I’ve been looking at fur, and the existing free shaders don’t seem to work with my texture’s alpha. I get a black outline, as seen here.