Peter Bay Bastian
7 年前
当前提交
ed185a44
共有 22 个文件被更改,包括 358 次插入 和 232 次删除
-
34MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Runtime/Implementation/NodeUtils.cs
-
18MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Views/StandardNodeEditorView.cs
-
22MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Views/SurfaceMasterNodeEditorView.cs
-
12MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/GraphAnchorPresenter.cs
-
110MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/MaterialGraphPresenter.cs
-
7MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/NodePreviewPresenter.cs
-
32MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/MaterialNodeView.cs
-
15MaterialGraphProject/Assets/UnityShaderEditor/Editor/Resources/Styles/MaterialGraph.uss
-
62MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/Graphs/Cracks.ShaderGraph
-
2MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/Graphs/Cracks.ShaderGraph.meta
-
79MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Graphs/MaterialSlot.cs
-
2MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/HLSLNode.cs
-
16MaterialGraphProject/Assets/UnityShaderEditor/Runtime/SurfaceModel/MetallicMasterNode.cs
-
32MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Views/NodeEditorHeaderView.cs
-
3MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/Views/NodeEditorHeaderView.cs.meta
-
34MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/PositionNode.cs
-
11MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/ShaderStage.cs
-
3MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/ShaderStage.cs.meta
-
29MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/VertexInterpolatorNode.cs
-
3MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/VertexInterpolatorNode.cs.meta
-
64MaterialGraphProject/Assets/NewNodes/Kill/VertexPositionNode.cs
-
0/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/PositionNode.cs.meta
62
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/Graphs/Cracks.ShaderGraph
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
using UnityEngine.Experimental.UIElements; |
|||
|
|||
namespace UnityEditor.MaterialGraph.Drawing.Inspector |
|||
{ |
|||
public class NodeEditorHeaderView : VisualElement |
|||
{ |
|||
VisualElement m_Title; |
|||
VisualElement m_Type; |
|||
|
|||
public NodeEditorHeaderView() |
|||
{ |
|||
m_Title = new VisualElement { name = "title", text = "" }; |
|||
Add(m_Title); |
|||
Add(new VisualElement { name = "preType", text = "(" }); |
|||
m_Type = new VisualElement { name = "type", text = "" }; |
|||
Add(m_Type); |
|||
Add(new VisualElement { name = "postType", text = ")" }); |
|||
} |
|||
|
|||
public string title |
|||
{ |
|||
get { return m_Title.text; } |
|||
set { m_Title.text = value; } |
|||
} |
|||
|
|||
public string type |
|||
{ |
|||
get { return m_Type.text; } |
|||
set { m_Type.text = value; } |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 157f3e805d124f169cf20967d94036b3 |
|||
timeCreated: 1504857315 |
|
|||
using UnityEngine.Graphing; |
|||
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Input/Geometry/Position")] |
|||
public class PositionNode : AbstractMaterialNode |
|||
{ |
|||
const string kOutputSlotName = "XYZW"; |
|||
|
|||
public const int OutputSlotId = 0; |
|||
|
|||
public PositionNode() |
|||
{ |
|||
name = "Position"; |
|||
UpdateNodeAfterDeserialization(); |
|||
} |
|||
|
|||
public sealed override void UpdateNodeAfterDeserialization() |
|||
{ |
|||
AddSlot(new MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, SlotValueType.Vector4, Vector4.zero, ShaderStage.Vertex)); |
|||
RemoveSlotsNameNotMatching(validSlots); |
|||
} |
|||
|
|||
protected int[] validSlots |
|||
{ |
|||
get { return new[] { OutputSlotId }; } |
|||
} |
|||
|
|||
public override string GetVariableNameForSlot(int slotId) |
|||
{ |
|||
return "v.vertex"; |
|||
} |
|||
} |
|||
} |
|
|||
using System; |
|||
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
public enum ShaderStage |
|||
{ |
|||
Dynamic, |
|||
Vertex, |
|||
Fragment |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 02d8af4c3fb9404ba3d6689c815c18d2 |
|||
timeCreated: 1504863207 |
|
|||
using UnityEngine.Graphing; |
|||
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Vertex Interpolation")] |
|||
public class VertexInterpolatorNode : AbstractMaterialNode |
|||
{ |
|||
const string k_InputSlotName = "In"; |
|||
const string k_OutputSlotName = "Out"; |
|||
|
|||
public const int InputSlotId = 0; |
|||
public const int OutputSlotId = 1; |
|||
|
|||
public VertexInterpolatorNode() |
|||
{ |
|||
name = "Position"; |
|||
UpdateNodeAfterDeserialization(); |
|||
} |
|||
|
|||
public sealed override void UpdateNodeAfterDeserialization() |
|||
{ |
|||
AddSlot(new MaterialSlot(InputSlotId, k_InputSlotName, k_InputSlotName, SlotType.Input, SlotValueType.Dynamic, Vector4.zero, ShaderStage.Vertex)); |
|||
AddSlot(new MaterialSlot(OutputSlotId, k_OutputSlotName, k_OutputSlotName, SlotType.Output, SlotValueType.Dynamic, Vector4.zero, ShaderStage.Fragment)); |
|||
RemoveSlotsNameNotMatching(k_ValidSlots); |
|||
} |
|||
|
|||
static readonly int[] k_ValidSlots = { InputSlotId, OutputSlotId }; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: bcb2926c7b8d4a61bc8773121674ad57 |
|||
timeCreated: 1504275680 |
|
|||
using UnityEngine.Graphing; |
|||
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
[Title("Input/Geometry/Vertex Position")] |
|||
public class VertexPositionNode : AbstractMaterialNode |
|||
{ |
|||
private const string kOutputSlotName = "XYZW"; |
|||
private const string kOutputSlotNameXYZ = "XYZ"; |
|||
private const string kOutputSlotNameX = "X"; |
|||
private const string kOutputSlotNameY = "Y"; |
|||
private const string kOutputSlotNameZ = "Z"; |
|||
private const string kOutputSlotNameW = "W"; |
|||
|
|||
public const int OutputSlotId = 0; |
|||
public const int OutputSlotIdXYZ = 1; |
|||
public const int OutputSlotIdX = 2; |
|||
public const int OutputSlotIdY = 3; |
|||
public const int OutputSlotIdZ = 4; |
|||
public const int OutputSlotIdW = 5; |
|||
|
|||
public VertexPositionNode() |
|||
{ |
|||
name = "VertexPostion"; |
|||
UpdateNodeAfterDeserialization(); |
|||
} |
|||
|
|||
public sealed override void UpdateNodeAfterDeserialization() |
|||
{ |
|||
AddSlot(new MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, SlotValueType.Vector4, Vector4.zero)); |
|||
AddSlot(new MaterialSlot(OutputSlotIdXYZ, kOutputSlotNameXYZ, kOutputSlotNameXYZ, SlotType.Output, SlotValueType.Vector3, Vector4.zero)); |
|||
AddSlot(new MaterialSlot(OutputSlotIdX, kOutputSlotNameX, kOutputSlotNameX, SlotType.Output, SlotValueType.Vector1, Vector4.zero)); |
|||
AddSlot(new MaterialSlot(OutputSlotIdY, kOutputSlotNameY, kOutputSlotNameY, SlotType.Output, SlotValueType.Vector1, Vector4.zero)); |
|||
AddSlot(new MaterialSlot(OutputSlotIdZ, kOutputSlotNameZ, kOutputSlotNameZ, SlotType.Output, SlotValueType.Vector1, Vector4.zero)); |
|||
AddSlot(new MaterialSlot(OutputSlotIdW, kOutputSlotNameW, kOutputSlotNameW, SlotType.Output, SlotValueType.Vector1, Vector4.zero)); |
|||
|
|||
RemoveSlotsNameNotMatching(validSlots); |
|||
} |
|||
|
|||
protected int[] validSlots |
|||
{ |
|||
get { return new[] { OutputSlotId, OutputSlotIdXYZ , OutputSlotIdX, OutputSlotIdY, OutputSlotIdZ, OutputSlotIdW }; } |
|||
} |
|||
|
|||
public override string GetVariableNameForSlot(int slotId) |
|||
{ |
|||
switch (slotId) |
|||
{ |
|||
case OutputSlotIdXYZ: |
|||
return "v.vertex.xyz"; |
|||
case OutputSlotIdX: |
|||
return "v.vertex.x"; |
|||
case OutputSlotIdY: |
|||
return "v.vertex.y"; |
|||
case OutputSlotIdZ: |
|||
return "v.vertex.z"; |
|||
case OutputSlotIdW: |
|||
return "v.vertex.w"; |
|||
default: |
|||
return "v.vertex"; |
|||
} |
|||
} |
|||
} |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue