Shader with simple drop shadow

I’m working on a 2D game that requires some drop shadow effects for some of the items in the background scenery.
I’ve been reading as much about Shaderlab as I can but still seem very lost.

Can someone point me in the right direction on how to make a simple drop shadow shader.
I’m using the Unlit/Transparent shader as the base as I use that for all my objects.

From what I understand… I should render my image in one pass…

Pass {
SetTexture [_MainTex] {
constantColor [_Color]
Combine Texture * constant, Texture * constant
}
}

Then add another pass with perhaps a vertex offset of some sort in some sort of shaded black?

How can I achieve this?

Thanks

It is possible with a post processing effect. Nvidia shader library has a sample to look at.

Hmm I’ve looked at their shaders… seems they need to be converted to work with Unity. Still trying to figure out how to do that.

Hey, just curious, did you manage to solve that issue ? I googled “drop shadow effect in unity” in google and your thread turned up, showing, I’m looking for the exact same thing :smile:
Maybe you could give a hint on how you solved this issue ?

I once wrote a tutorial about rendering drop shadows with a GLSL shader:
http://en.wikibooks.org/wiki/GLSL_Programming/Unity/Shadows_on_Planes

On Windows you have to start Unity with the -force-opengl command line argument to use GLSL shaders (see http://unity3d.com/support/documentation/Manual/Command%20Line%20Arguments.html )

(I guess you didn’t find this page because you included the word “effect” in your google search.)

Got here via Google as well. I guess no one’s written one via Shader Graph to help numpties like me yet!