- Home /
render order/ multipass shaders (hidden surface shader path)
Is it possible to render one material / shader with two passes in different Queues?
I have a character surface shader and a pass for rendering the character with special color behind objects (zfail). It is important that for multipart characters all special passes of all character (parts) are rendered first and then all surface shader passes of all character (parts).
I gave the pass a different Queue Tag but this changed nothing:
Shader
{
Subshader
{
Pass
{
// hidden surface pass
Tags { "Queue"="Transparent-2" }
// ..
}
// main rendering surface shader
Tags { "Queue"="Transparent-1" }
// ..
}
}
Am I doing something wrong? Is it possibly what I want or do I need to solve that with custom scripting (and painting)?
ok, as the unity material system is not as powerful as i thought: what is is the most efficient way to render the characters with a special shader? First I thought replacement shaders would be what I need, but the characters need to be rendered during normal rendering with the special shader: rendering static level rendering hidden surface shader characters rendering character normal material
Which is not possible if I understand the replacement correctly.
Are there better ways than duplication the gameobjects with a skinned mesh renderer using the special material?
is object duplication the only way? any better suggestions?
$$anonymous$$aybe you should log a bug about the material system. I'm not sure if they consider it a bug or feature request. I can't help you further without knowing more about what you actually need to do. You've figured out all you can, in terms of what you've said you need to do. However, there may be a different way of tackling the problem than what you have come up with, subverting the lack of flexibility of the material system.
Answer by Jessy · Jan 09, 2012 at 03:18 PM
Queue is not a Pass tag. It is a SubShader tag, and has no effect within Pass{}. You'll have to use multiple materials to do this, if you really have to do what you said you need to do. Try to think of a way to avoid that if you can, as Unity doesn't make this easy on you. It's not a big deal if you only have one submesh, but if you have multiple, you're probably out of luck for that object.
unfortunately our characters have multiple submeshes/part. what is the easiest way to paint them additionally with the special hidden surface pass (before regular rendering)?