You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.1 KiB
35 lines
1.1 KiB
using UnityEngine;
|
|
using UnityEditor.Graphing;
|
|
using UnityEditor.ShaderGraph.Internal;
|
|
|
|
namespace UnityEditor.ShaderGraph
|
|
{
|
|
[Title("Input", "Geometry", "Tangent Vector")]
|
|
class TangentVectorNode : GeometryNode, IMayRequireTangent
|
|
{
|
|
public const int kOutputSlotId = 0;
|
|
public const string kOutputSlotName = "Out";
|
|
|
|
public TangentVectorNode()
|
|
{
|
|
name = "Tangent Vector";
|
|
UpdateNodeAfterDeserialization();
|
|
}
|
|
|
|
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();
|
|
}
|
|
}
|
|
}
|