|
|
|
|
|
|
|
|
|
|
public static GUIContent normalMapSpaceText = new GUIContent("Normal/Tangent Map space", ""); |
|
|
|
public static GUIContent normalMapText = new GUIContent("Normal Map", "Normal Map (BC7/BC5/DXT5(nm))"); |
|
|
|
public static GUIContent normalMapOSText = new GUIContent("Normal Map OS", "Normal Map (BC7/DXT1/RGB)"); |
|
|
|
public static GUIContent specularOcclusionMapText = new GUIContent("Specular Occlusion Map (RGBA)", "Specular Occlusion Map"); |
|
|
|
public static GUIContent horizonFadeText = new GUIContent("Horizon Fade (Spec occlusion)", "horizon fade is use to control specular occlusion"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static GUIContent tangentMapText = new GUIContent("Tangent Map", "Tangent Map (BC5) - DXT5 for test"); |
|
|
|
public static GUIContent tangentMapText = new GUIContent("Tangent Map", "Tangent Map (BC7/BC5/DXT5(nm))"); |
|
|
|
public static GUIContent tangentMapOSText = new GUIContent("Tangent Map OS", "Tangent Map (BC7/DXT1/RGB)"); |
|
|
|
public static GUIContent anisotropyText = new GUIContent("Anisotropy", "Anisotropy scale factor"); |
|
|
|
public static GUIContent anisotropyMapText = new GUIContent("Anisotropy Map (B)", "Anisotropy"); |
|
|
|
|
|
|
|
|
|
|
protected const string kHeightCenter = "_HeightCenter"; |
|
|
|
protected MaterialProperty tangentMap = null; |
|
|
|
protected const string kTangentMap = "_TangentMap"; |
|
|
|
protected MaterialProperty tangentMapOS = null; |
|
|
|
protected const string kTangentMapOS = "_TangentMapOS"; |
|
|
|
protected MaterialProperty anisotropy = null; |
|
|
|
protected const string kAnisotropy = "_Anisotropy"; |
|
|
|
protected MaterialProperty anisotropyMap = null; |
|
|
|
|
|
|
heightAmplitude = FindProperty(kHeightAmplitude, props); |
|
|
|
heightCenter = FindProperty(kHeightCenter, props); |
|
|
|
tangentMap = FindProperty(kTangentMap, props); |
|
|
|
tangentMapOS = FindProperty(kTangentMapOS, props); |
|
|
|
anisotropy = FindProperty(kAnisotropy, props); |
|
|
|
anisotropyMap = FindProperty(kAnisotropyMap, props); |
|
|
|
specularColor = FindProperty(kSpecularColor, props); |
|
|
|
|
|
|
|
|
|
|
protected void ShaderStandardInputGUI() |
|
|
|
{ |
|
|
|
m_MaterialEditor.TexturePropertySingleLine(Styles.tangentMapText, tangentMap); |
|
|
|
if ((NormalMapSpace)normalMapSpace.floatValue == NormalMapSpace.TangentSpace) |
|
|
|
{ |
|
|
|
m_MaterialEditor.TexturePropertySingleLine(Styles.tangentMapText, tangentMap); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
m_MaterialEditor.TexturePropertySingleLine(Styles.tangentMapOSText, tangentMapOS); |
|
|
|
} |
|
|
|
m_MaterialEditor.ShaderProperty(anisotropy, Styles.anisotropyText); |
|
|
|
m_MaterialEditor.TexturePropertySingleLine(Styles.anisotropyMapText, anisotropyMap); |
|
|
|
} |
|
|
|
|
|
|
else |
|
|
|
{ |
|
|
|
// No scaling in object space
|
|
|
|
m_MaterialEditor.TexturePropertySingleLine(Styles.normalMapText, normalMapOS); |
|
|
|
m_MaterialEditor.TexturePropertySingleLine(Styles.normalMapOSText, normalMapOS); |
|
|
|
} |
|
|
|
|
|
|
|
m_MaterialEditor.TexturePropertySingleLine(Styles.heightMapText, heightMap); |
|
|
|
|
|
|
{ |
|
|
|
// With details map, we always use a normal map and Unity provide a default (0, 0, 1) normal map for it
|
|
|
|
SetKeyword(material, "_NORMALMAP", material.GetTexture(kNormalMap) || material.GetTexture(kDetailMap)); |
|
|
|
SetKeyword(material, "_TANGENTMAP", material.GetTexture(kTangentMap)); |
|
|
|
SetKeyword(material, "_TANGENTMAP", material.GetTexture(kTangentMapOS)); |
|
|
|
SetKeyword(material, "_TANGENTMAP", material.GetTexture(kTangentMap)); |
|
|
|
SetKeyword(material, "_ANISOTROPYMAP", material.GetTexture(kAnisotropyMap)); |
|
|
|
SetKeyword(material, "_DETAIL_MAP", material.GetTexture(kDetailMap)); |
|
|
|
SetKeyword(material, "_SUBSURFACE_RADIUS_MAP", material.GetTexture(kSubsurfaceRadiusMap)); |
|
|
|