Adding normal map to Sprite shader

Hello, I would really like to add a normal map to the Default Sprite shader. Right now i’m using the Default Diffuse Sprite shader, with point lighting. It looks nice, but not nearly as nice as this: alt text

Which is accomplished using a normalmap on a sprite.
My question is how to implement normalmapping into the Default Diffuse Sprite shader. I’ve searched for a finished shader asset on the asset store but to no avail. Is this a very difficult thing to do? I have no prior experience in shaderLab or with creating shaders.


I suggest having a read of Writing a SpriteLamp Shader in Unity.


First of all a small disclaimer, I have no prior experience using thisshader. I skimmed over the blog when it was posted on reddit a while back but that is all.

Today I dropped it into unity (windows) and it was throwing a few incorrect number of arguments to numeric-type constructor errors. I was able to fix them by modifying line 72.

output.uv = float2(input.uv);
output.uv = input.uv;

At that point it all seems to work as expected.

I borrowed a few textures from here and created this test scene:

While these textures produce an output that is pretty ugly, it responds correctly when I move the light source and seems to be working as advertised.