浏览代码

Added AddSub Blending mode.

Added Substance Designer AddSub Blending Mode.
Formula Add Sub:   2.0*s+d-1.0
/main
RinaldoTjan 8 年前
当前提交
e8450e60
共有 3 个文件被更改,包括 11 次插入3 次删除
  1. 11
      MaterialGraphProject/Assets/Rinaldo/BlendModeNode.cs
  2. 1
      MaterialGraphProject/Assets/Rinaldo/BlendModesEnum.cs
  3. 2
      MaterialGraphProject/Assets/Rinaldo/Editor/BlendModeNodePresenter.cs

11
MaterialGraphProject/Assets/Rinaldo/BlendModeNode.cs


}
}
}
/*This is to overide input to be vector 3, not really necessary anymore*/
/*This is to overide input to be vector 3, not really necessary */
/*
protected override MaterialSlot GetInputSlot1()
{

var outputString = new ShaderGenerator();
switch (m_BlendMode)
{
case BlendModesEnum.AddSub:
outputString.AddShaderChunk(GetFunctionPrototype("arg1", "arg2"), false);
outputString.AddShaderChunk("{", false);
outputString.Indent();
outputString.AddShaderChunk("return 2.0 * arg1 + arg2 - 1.0;", false);
outputString.Deindent();
outputString.AddShaderChunk("}", false);
break;
case BlendModesEnum.Burn:
outputString.AddShaderChunk(GetFunctionPrototype("arg1", "arg2"), false);
outputString.AddShaderChunk("{", false);

outputString.AddShaderChunk("}", false);
break;
}
visitor.AddShaderChunk(outputString.GetShaderString(0), true);
}
}

1
MaterialGraphProject/Assets/Rinaldo/BlendModesEnum.cs


{
public enum BlendModesEnum
{
AddSub,
Burn,
Darken,
Difference,

2
MaterialGraphProject/Assets/Rinaldo/Editor/BlendModeNodePresenter.cs


*/
public override float GetHeight()
{
return 3 * (EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing) + EditorGUIUtility.standardVerticalSpacing;
return EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing + EditorGUIUtility.standardVerticalSpacing;
}
}

正在加载...
取消
保存