您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
39 行
1.2 KiB
39 行
1.2 KiB
using UnityEngine;
|
|
using UnityEditor.Graphing;
|
|
|
|
namespace UnityEditor.ShaderGraph
|
|
{
|
|
[Title("Input", "Geometry", "Tangent Vector")]
|
|
public class TangentVectorNode : GeometryNode, IMayRequireTangent
|
|
{
|
|
public const int kOutputSlotId = 0;
|
|
public const string kOutputSlotName = "Out";
|
|
|
|
public TangentVectorNode()
|
|
{
|
|
name = "Tangent Vector";
|
|
UpdateNodeAfterDeserialization();
|
|
}
|
|
|
|
public override string documentationURL
|
|
{
|
|
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Tangent-Vector-Node"; }
|
|
}
|
|
|
|
public sealed override void UpdateNodeAfterDeserialization()
|
|
{
|
|
AddSlot(new Vector3MaterialSlot(kOutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, new Vector4(0, 0, 1, 1)));
|
|
RemoveSlotsNameNotMatching(new[] { kOutputSlotId });
|
|
}
|
|
|
|
public override string GetVariableNameForSlot(int slotId)
|
|
{
|
|
return string.Format("IN.{0}", space.ToVariableName(InterpolatorType.Tangent));
|
|
}
|
|
|
|
public NeededCoordinateSpace RequiresTangent(ShaderStageCapability stageCapability)
|
|
{
|
|
return space.ToNeededCoordinateSpace();
|
|
}
|
|
}
|
|
}
|