Unity Shader Reference Sheet [WIP] ...with a question

Hi,

I am working on a design project to provide quick refrence for writing shader.

I have finished the part of vert/frag shader and you can get it here (http://guoboism.com/UnityShaderRef)
Contact @guoboism for any error or suggestion

Here I have a question:
Is Lighting On | Off will do anything in a vert/frag shader?

Together will other legacy commands mentioned in Unity - Manual: ShaderLab: defining a Pass, they are “considered deprecated functionality”.

So, is writing “Lighting Off” pointless in vert/frag shaders?

Nope. They’re a holdover from fixed function shaders. Otherwise they’re completely ignored. If you write a fixed function shader or use an existing one with the Lighting On it will do someone even though Unity doesn’t actually use fixed function shaders anymore. Instead fixed function shaders are treated like surface shaders, i.e. they generate a vertex fragment shader that the engine actually uses.

Similarly the “Fog” and “AlphaTest” command shows up on a lot of older vert / frag shaders, but neither do anything either. Again they still work if you have a fixed function shader, though the fog command is actually somewhat incomplete as it no longer supports color overrides, most commonly needed for additive shaders which should fog to black.

And some comments:
The shader in the reference card should probably be an actual properly rendering shader.
Might be nice to list defaults.
You’re using a mismatched queue and render type.
Render type names are mostly arbitrary, but actual exist for matching passes in replacement shaders like for rendering the camera depth normal texture.
PreviewType is not a true/false tag.
Name is not part of LOD.
ColorMask defaults to RGBA, and should be listed explicitly.
Usually you don’t use AlphaToMask and blend modes together in a single pass.
You’re missing the optional but useful Category.
You’re missing UsePass, though you have Name.
You’re missing Pass specific LightMode tags.

Thanks for you comments!

I believe it’s since Unity 5.4, that Unity recommends to use UnityObjectToClipPos(v.vertex), which basically is doing the same thing as mul(UNITY_MATRIX_MVP, v.vertex), but also works with single pass stereo rendering as far as I know.

If you download their 5.5 built-in shader package, you see that they replaced mul(UNITY_MATRIX_MVP, v.vertex) with UnityObjectToClipPos(v.vertex) in eg their particle shaders already.

Maybe you want to add that to your document.