Paul Demeulenaere
8 年前
当前提交
c1f9ae7d
共有 4 个文件被更改,包括 82 次插入 和 5 次删除
-
9MaterialGraphProject/Assets/UnityShaderEditor/Runtime/SubGraph/SubGraphNode.cs
-
18MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Util/ShaderGenerator.cs
-
48MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/WorldSpaceBitangentNode.cs
-
12MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/WorldSpaceBitangentNode.cs.meta
|
|||
using UnityEngine.Graphing; |
|||
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
public interface IMayRequireBitangent |
|||
{ |
|||
bool RequiresBitangent(); |
|||
} |
|||
|
|||
[Title("Input/World Bitangent Node")] |
|||
public class WorldSpaceBitangentNode : AbstractMaterialNode, IMayRequireBitangent |
|||
{ |
|||
public const int kOutputSlotId = 0; |
|||
public const string kOutputSlotName = "Bitangent"; |
|||
|
|||
public WorldSpaceBitangentNode() |
|||
{ |
|||
name = "World Bitangent"; |
|||
UpdateNodeAfterDeserialization(); |
|||
} |
|||
|
|||
public sealed override void UpdateNodeAfterDeserialization() |
|||
{ |
|||
AddSlot(new MaterialSlot(kOutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, SlotValueType.Vector3, new Vector4(0, 0, 1, 1))); |
|||
RemoveSlotsNameNotMatching(new[] { kOutputSlotId }); |
|||
} |
|||
|
|||
public override bool hasPreview |
|||
{ |
|||
get { return true; } |
|||
} |
|||
|
|||
public override PreviewMode previewMode |
|||
{ |
|||
get { return PreviewMode.Preview3D; } |
|||
} |
|||
|
|||
public override string GetVariableNameForSlot(int slotId) |
|||
{ |
|||
return ShaderGeneratorNames.WorldSpaceBitangent; |
|||
} |
|||
|
|||
public bool RequiresBitangent() |
|||
{ |
|||
return true; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 25ded6c13e7523d48935f8bd1b9afcb6 |
|||
timeCreated: 1481041579 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue