浏览代码

Add Normal Strength node

/main
Matt Dean 7 年前
当前提交
7c2a62b0
共有 2 个文件被更改,包括 45 次插入0 次删除
  1. 34
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Artistic/Normal/NormalStrengthNode.cs
  2. 11
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Artistic/Normal/NormalStrengthNode.cs.meta

34
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Artistic/Normal/NormalStrengthNode.cs


using System.Reflection;
using UnityEngine;
using UnityEditor.Graphing;
namespace UnityEditor.ShaderGraph
{
[Title("Artistic", "Normal", "Normal Strength")]
internal class NormalStrengthNode : CodeFunctionNode
{
public NormalStrengthNode()
{
name = "Normal Strength";
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_NormalStrength", BindingFlags.Static | BindingFlags.NonPublic);
}
static string Unity_NormalStrength(
[Slot(0, Binding.None, 0, 0, 1, 0)] Vector3 In,
[Slot(1, Binding.None, 1, 1, 1, 1)] Vector1 Strength,
[Slot(2, Binding.None)] out Vector3 Out)
{
Out = Vector3.up;
return
@"
{
Out = {precision}3(In.rg * Strength, 1);
}
";
}
}
}

11
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Artistic/Normal/NormalStrengthNode.cs.meta


fileFormatVersion: 2
guid: c003a641a03160e478f4ce7ee8ce8da6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存