In case its useful to anyone but I’ve put together an Uber Shader for rendering sprites and other alpha blended objects:
It supports normal maps, specular, emission and a ton of other stuff, plus works with either multipass pixel lighting OR single pass vertex lighting. (Vertex lighting packs a lot of stuff into texture channels so it can approximate per pixel effects).
It also supports rending back faces with corrected tangents.
Anyways its free / open source so hopefully it might help some peops
Looking great! Is there a benefit to use this before Standard shader? Obviously theres few cool features, but if i replace my Standard shader material for sprites (I use normal and metallic maps) will there be a benefit? Performance boost?
The main benefit is you can use vertex lighting which means rendering is done in a single pass.
This is firstly quicker than mulit-pass based lighting unity’s standard shader does, plus also means you can render sprites with sub meshes without getting any nasty overdraw from additional lights passes. This is normally the case with skeleton based animations like ones from Spine (Spine actually now ships with a version of these shaders!).
Obviously nothing’s free in programing so vertex lighting can be less accurate than forward based per pixel lighting, but if you’re sprite mesh is generated with enough verts you won’t notice the difference.
You can also turn off what you don’t use which will speed up the shader in comparison to the standard shader.
I recommend playing around and seeing what works best - every project is different these shaders let you do some things the standard shader can’t do but there will be times where the unity standard shader works and makes the most sense too!
This is a shader, you shouldnt really have to make different versions for different versions of unity until 2018 and SRP is out. Essentially, yes it will likely work.
Also, 5.6 is way more unstable that 2017.3. All other 2017 releases were garbage but 2017.3 is well worth it, you should update unless you have a very good reason (i.e. tech that requires lower version of unity specifically)
So I started using this shader for the purposes of Depth of Field on SpriteRenderers, and it works perfectly for that! However, shortly thereafter, I started using Sorting Group Components, and noticed I was getting inconsistent results of either the Sorting Group working perfectly, or not at all. At first I thought it was something to do with the Sorting Group or my configuration or something, but if I only change the material for my SpriteRenderers back to Sprites/Default, the Sorting Group seems to consistently go back to working properly 100% of the time. This also happens if I simply disable the “Write to Depth” property on the material for these shaders. So now I’m inclined to believe this is an issue with these shaders, and specifically to do with literally the only feature I really wanted from them >_>
Is this something you’re aware of @LostInActon ? My results are sorta consistent, but not very reproducable… It’s really weird. But I have some local prefabs here that show the issue.
This is all seen in Unity 2018.2.3f1, using a clone of the GIT repo for these shaders as of Sept 20 or so.