- Home /
render in front of 2D sprite - Unity 4.3
Hi,
I am trying to make a shader which renders in front of all 2D sprites (no matter what layer the sprites are in). I haven't found a way to do this yet - does anyone have any ideas?
Best, Simon Millard
Did you try Queue tag in your shader : Tags {"Queue" = "Overlay+100 " }
Thanks for the quick reply mujpir. I actually had : Tags { "Queue"="Overlay" - already, but changing it to "Overlay+100" doesn't seem to help either. Unfortunately I'm rather new to Shader program$$anonymous$$g, and no matter what I try I just can't seem to render stuff in front of those damn 2D sprites!
Answer by burnill · Dec 03, 2013 at 02:36 PM
You can set up the default layer to be ahead of the layers your sprites are on.
or try this:
var RenderAmount : int = 3000;
function Start () {
renderer.material.renderQueue = RenderAmount;
}
Thanks for your reply burnill. Unfortunately the render queue I am using for the shader is already greater than 3000 (Overlay is 4000 : http://docs.unity3d.com/Documentation/Components/SL-SubshaderTags.html ). Also, since I am working on a plugin for the AssetStore, I cannot change the layers - it has to work with the shader out of the box (I apologies for not specifying this in the question).
Your answer
![](https://koobas.hobune.stream/wayback/20220613123313im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Lines at the top of sprites 3 Answers
Sprite Editor won't create files. 2 Answers
2D Games with Unity? 2 Answers