Note that you don’t need to declare all functions. A lighting model either uses view direction or it does not. Similarly, if the lighting model only works in forward rendering, do not declare the _Deferred or _Prepass function. This ensures that Shaders that use it only compile to forward rendering.

Custom GI

Declare the following function to customize the decoding lightmap data and probes:

Note that to decode standard Unity lightmaps and SH probes, you can use the built-in DecodeLightmap and ShadeSHPerPixel functions, as seen in UnityGI_Base in the UnityGlobalIllumination.cginc file inside Unity (Windows: <unity install path>/Data/CGIncludes/UnityGlobalIllumination.cginc; macOS: /Applications/Unity/Unity.app/Contents/CGIncludes/UnityGlobalIllumination.cginc_).