浏览代码

Contrast Node

/main
Matt Dean 7 年前
当前提交
471c7357
共有 1 个文件被更改,包括 7 次插入10 次删除
  1. 17
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Artistic/Adjustment/ContrastNode.cs

17
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Artistic/Adjustment/ContrastNode.cs


namespace UnityEditor.ShaderGraph
{
[Title("Art/Adjustments/Contrast")]
[Title("Artistic/Adjustment/Contrast")]
public class ContrastNode : CodeFunctionNode
{
public ContrastNode()

}
static string Unity_Contrast(
[Slot(0, Binding.None)] Vector3 input,
[Slot(1, Binding.None)] Vector1 contrast,
[Slot(2, Binding.None)] Vector1 midPoint,
[Slot(3, Binding.None)] out Vector3 result)
[Slot(0, Binding.None)] Vector3 In,
[Slot(1, Binding.None, 1, 1, 1, 1)] Vector1 Contrast,
[Slot(2, Binding.None)] out Vector3 Out)
result = Vector2.zero;
Out = Vector2.zero;
// Contrast (reacts better when applied in log)
// Optimal range: [0.0, 2.0]]
// From PostProcessing
result = (input - midPoint) * contrast + midPoint;
{precision} midpoint = pow(0.5, 2.2);
Out = (In - midpoint) * Contrast + midpoint;
}";
}
}
正在加载...
取消
保存