|
|
|
|
|
|
|
|
|
|
protected MaterialProperty coatMask = null; |
|
|
|
protected const string kCoatMask = "_CoatMask"; |
|
|
|
protected MaterialProperty coatMaskMap = null; |
|
|
|
protected const string kCoatMaskMap = "_CoatMaskMap"; |
|
|
|
|
|
|
|
protected MaterialProperty emissiveColorMode = null; |
|
|
|
protected const string kEmissiveColorMode = "_EmissiveColorMode"; |
|
|
|
|
|
|
|
|
|
|
// clear coat
|
|
|
|
coatMask = FindProperty(kCoatMask, props); |
|
|
|
coatMaskMap = FindProperty(kCoatMaskMap, props); |
|
|
|
|
|
|
|
// Transparency
|
|
|
|
refractionMode = FindProperty(kRefractionMode, props, false); |
|
|
|
|
|
|
|
|
|
|
protected void ShaderClearCoatInputGUI() |
|
|
|
{ |
|
|
|
m_MaterialEditor.ShaderProperty(coatMask, Styles.coatMaskText); |
|
|
|
m_MaterialEditor.TexturePropertySingleLine(Styles.coatMaskText, coatMaskMap, coatMask); |
|
|
|
} |
|
|
|
|
|
|
|
protected void ShaderAnisoInputGUI() |
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected void DoLayerGUI(Material material, int layerIndex) |
|
|
|
protected void DoLayerGUI(Material material, int layerIndex, bool isLayeredLit) |
|
|
|
{ |
|
|
|
EditorGUILayout.LabelField(Styles.InputsText, EditorStyles.boldLabel); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch ((BaseLitGUI.MaterialId)materialID.floatValue) |
|
|
|
{ |
|
|
|
case BaseLitGUI.MaterialId.LitSSS: |
|
|
|
case BaseLitGUI.MaterialId.LitSSSAndTransmission: |
|
|
|
ShaderSSSInputGUI(material, layerIndex); |
|
|
|
break; |
|
|
|
case BaseLitGUI.MaterialId.LitStandard: |
|
|
|
|
|
|
case BaseLitGUI.MaterialId.LitSpecular: |
|
|
|
ShaderSpecularColorInputGUI(material); |
|
|
|
break; |
|
|
|
case BaseLitGUI.MaterialId.LitClearCoat: |
|
|
|
ShaderClearCoatInputGUI(); |
|
|
|
break; |
|
|
|
|
|
|
|
if (!isLayeredLit) |
|
|
|
{ |
|
|
|
ShaderClearCoatInputGUI(); |
|
|
|
} |
|
|
|
|
|
|
|
EditorGUILayout.Space(); |
|
|
|
|
|
|
|
EditorGUI.BeginChangeCheck(); |
|
|
|
|
|
|
|
|
|
|
protected override void MaterialPropertiesGUI(Material material) |
|
|
|
{ |
|
|
|
DoLayerGUI(material, 0); |
|
|
|
DoLayerGUI(material, 0, false); |
|
|
|
DoEmissiveGUI(material); |
|
|
|
// The parent Base.ShaderPropertiesGUI will call DoEmissionArea
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
BaseLitGUI.MaterialId materialId = (BaseLitGUI.MaterialId)material.GetFloat(kMaterialID); |
|
|
|
|
|
|
|
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_SUBSURFACE_SCATTERING", materialId == BaseLitGUI.MaterialId.LitSSS); |
|
|
|
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_TRANSMISSION", materialId == BaseLitGUI.MaterialId.LitSSS); |
|
|
|
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_SUBSURFACE_SCATTERING", materialId == BaseLitGUI.MaterialId.LitSSSAndTransmission); |
|
|
|
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_TRANSMISSION", materialId == BaseLitGUI.MaterialId.LitSSSAndTransmission); |
|
|
|
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_CLEAR_COAT", materialId == BaseLitGUI.MaterialId.LitClearCoat); |
|
|
|
// No material Id for clear coat, just test the attribute
|
|
|
|
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_CLEAR_COAT", material.GetFloat(kCoatMask) > 0.0 || material.GetTexture(kCoatMaskMap); |
|
|
|
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_IRIDESCENCE", materialId == BaseLitGUI.MaterialId.LitIridescence); |
|
|
|
CoreUtils.SetKeyword(material, "_MATERIAL_FEATURE_SPECULAR_COLOR", materialId == BaseLitGUI.MaterialId.LitSpecular); |
|
|
|
|
|
|
|