multi_compile使用
属性中声明:[KeywordEnum(Horizontal, Vertical)] _UVOrientation (“UV Orientation”, Float) = 0在cg代码块里
#pragma multi_compile _UVORIENTATION_HORIZONTAL _UVORIENTATION_VERTICAL
#if _UVORIENTATION_HORIZONTAL
worldOrientation = worldTangent;
#elif _UVORIENTATION_VERTICAL
worldOrientation = normalize(cross(s.Normal, worldTangent) * s.tangent_input.w);
#endif
shader_feature的使用打包会有问题,所以还是用multi_compile
- UNITY_OPAQUE_ALPHA(c.a);
/*此函数定义在UnityCG.cginc文件中,
具体定义为:#define UNITY_OPAQU