- Home /
Billboard trees - changing the render queue
Hi. I'm trying to create a scene, and I've hit a problem with tree billboards. It turns out they are rendered with the queue "Transparent-100" (which seems odd to me), but this is problematic, as I have a scene that has a river, connecting to a lake. The river uses the queue "Transparent", and the lake (using Unity's pro water) renders to the queue "Transparent-10". The river has to be rendered above the lake so that the blending between them works correctly. Unfortunately, Unity's water system breaks down if it's rendered at the queue "Transparent-110" (which it needs to be for the river to be rendered at "Transparent-100"). I'm wondering if there is a way I can render the tree billboards at "Transparent", rather than "Transparent-100", as I can't access the shader being used. Can anyone help me to solve this problem?
Here is a picture of my scene, highlighting the error:
You can change the renderQueue for a material with $$anonymous$$aterial.renderQueue.
The renderqueue for Background is 1000, Geometry is 2000, AlphaTest is 2450, Transparent is 3000 and Overlay is 4000.
I know, but the problem is that I can't access the material of the billboarded trees in order to change the render queue, as it's dealt with automatically by Unity.
oh, i thought you have access to the material, just not the shader, never$$anonymous$$d then.
HL, are these the tree-billboards system which Unity gives you as part of their "Terrain" system? (I have never used their "Terrain" system for any reason, so I don't know about it!)
It appears to work correctly if I set the water depth to "Transparent-200" ins$$anonymous$$d of "Transparent-110", but I'd still rather change the depth of the trees if possible, as having the water shaders on a queue that low may cause problems elsewhere.
Well, this issue has hit me again with other objects. Could anyone help me to change the render queue of the trees themselves? I've looked in the standard shaders, but I haven't found anything setting the render queue for what is apparently the billboard shader. Can anyone point me in the right direction?
So I've found the source code for the BillboardTree shader, but no idea how to apply that to override the terrain shaders. Can anyone help me out with this?