浏览代码

Correctly shows HeightMap in LayeredLit shader UI when using height based blend without any displacement.

/main
Julien Ignace 6 年前
当前提交
4f420674
共有 2 个文件被更改,包括 9 次插入7 次删除
  1. 10
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/LayeredLit/LayeredLitUI.cs
  2. 6
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/Lit/LitUI.cs

10
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/LayeredLit/LayeredLitUI.cs


MaterialProperty[] showLayer = new MaterialProperty[kMaxLayerCount];
const string kShowLayer = "_ShowLayer";
bool m_UseHeightBasedBlend;
protected override void FindMaterialProperties(MaterialProperty[] props)
{
base.FindMaterialLayerProperties(props);

EditorGUILayout.Space();
}
DoLayerGUI(material, layerIndex, true);
DoLayerGUI(material, layerIndex, true, m_UseHeightBasedBlend);
if (layerIndex == 0)
EditorGUILayout.Space();

EditorGUI.BeginChangeCheck();
EditorGUI.showMixedValue = useHeightBasedBlend.hasMixedValue;
bool enabled = EditorGUILayout.Toggle(styles.useHeightBasedBlendText, useHeightBasedBlend.floatValue > 0.0f);
m_UseHeightBasedBlend = EditorGUILayout.Toggle(styles.useHeightBasedBlendText, useHeightBasedBlend.floatValue > 0.0f);
useHeightBasedBlend.floatValue = enabled ? 1.0f : 0.0f;
useHeightBasedBlend.floatValue = m_UseHeightBasedBlend ? 1.0f : 0.0f;
if (enabled)
if (m_UseHeightBasedBlend)
{
EditorGUI.indentLevel++;
m_MaterialEditor.ShaderProperty(heightTransition, styles.heightTransition);

6
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Material/Lit/LitUI.cs


}
}
protected void DoLayerGUI(Material material, int layerIndex, bool isLayeredLit)
protected void DoLayerGUI(Material material, int layerIndex, bool isLayeredLit, bool showHeightMap)
{
EditorGUILayout.LabelField(Styles.InputsText, EditorStyles.boldLabel);

}
DisplacementMode displaceMode = (DisplacementMode)displacementMode.floatValue;
if(displaceMode != DisplacementMode.None)
if(displaceMode != DisplacementMode.None || showHeightMap)
{
EditorGUI.BeginChangeCheck();
m_MaterialEditor.TexturePropertySingleLine(Styles.heightMapText, heightMap[layerIndex]);

protected override void MaterialPropertiesGUI(Material material)
{
DoLayerGUI(material, 0, false);
DoLayerGUI(material, 0, false, false);
DoEmissiveGUI(material);
// The parent Base.ShaderPropertiesGUI will call DoEmissionArea
}

正在加载...
取消
保存