1、首先enable 关键字(shader keyword)
**.material.EnableKeyword("_EMISSION");
uity中常用的关键字有:
_NORMALMAP | Normal Mapping |
_ALPHATEST_ON | “Cut out” Transparency Rendering Mode |
_ALPHABLEND_ON | “Fade” Transparency Rendering Mode |
_ALPHAPREMULTIPLY_ON | “Transparent” Transparency Rendering Mode |
_EMISSION | Emission Colour or Emission Mapping |
_PARALLAXMAP | Height Mapping |
_DETAIL_MULX2 | Secondary “Detail” Maps (Albedo & Normal Map) |
_METALLICGLOSSMAP | Metallic/Smoothness Mapping in Metallic Workflow |
_SPECGLOSSMAP | Specular/Smoothness Mapping in Specular Workflow |
2、使用shader中的属性
常用的属性有:
-
_Color
-
_MainTex
-
_Cutoff
-
_Glossiness
_Metallic
-
_MetallicGlossMap
-
_BumpScale
-
_BumpMap
-
_Parallax
-
_ParallaxMap
-
_OcclusionStrength
-
_OcclusionMap
-
_EmissionColor
-
_EmissionMap
_DetailMask
-
_DetailAlbedoMap
-
_DetailNormalMapScale
-
_DetailNormalMap
-
_UVSec
-
_EmissionScaleUI
-
_EmissionColorUI
-
_Mode
-
_SrcBlend
-
_DstBlend
_ZWrite