您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
35 行
876 B
35 行
876 B
using System.Reflection;
|
|
|
|
namespace UnityEngine.MaterialGraph
|
|
{
|
|
[Title ("Art/Adjustments/Contrast")]
|
|
public class ContrastNode : CodeFunctionNode
|
|
{
|
|
public ContrastNode()
|
|
{
|
|
name = "Contrast";
|
|
}
|
|
|
|
protected override MethodInfo GetFunctionToConvert()
|
|
{
|
|
return GetType().GetMethod("Unity_Contrast", BindingFlags.Static | BindingFlags.NonPublic);
|
|
}
|
|
|
|
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)
|
|
{
|
|
result = Vector2.zero;
|
|
return
|
|
@"
|
|
{
|
|
// Contrast (reacts better when applied in log)
|
|
// Optimal range: [0.0, 2.0]]
|
|
// From PostProcessing
|
|
result = (input - midPoint) * contrast + midPoint;
|
|
}";
|
|
}
|
|
}
|
|
}
|