浏览代码
Fix nodes so that the master node now can do a mapping from vertex input to usage by the master node.
/main
Fix nodes so that the master node now can do a mapping from vertex input to usage by the master node.
/main
Tim Cooper
8 年前
当前提交
bc6130d7
共有 20 个文件被更改,包括 200 次插入 和 123 次删除
-
10MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Editor/Testing/IntegrationTests/SerializationTests.cs
-
17MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Runtime/Implementation/SerializableGraph.cs
-
2MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Runtime/Implementation/SerializableNode.cs
-
24MaterialGraphProject/Assets/GraphFramework/SerializableGraph/Runtime/Util/SerializationHelper.cs
-
1MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/IntegrationTests/ShaderGenerationTest.cs
-
29MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Graphs/AbstractMaterialGraph.cs
-
9MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/AbstractSurfaceMasterNode.cs
-
2MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/ScreenPosNode.cs
-
4MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/TextureNode.cs
-
3MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/UVNode.cs
-
6MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/WorldSpaceNormalNode.cs
-
26MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Util/ShaderGenerator.cs
-
50MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/WorldSpacePositionNode.cs
-
50MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/WorldSpaceViewDirectionNode.cs
-
45MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/ViewDirectionNode.cs
-
45MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/WorldPosNode.cs
-
0/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/WorldSpaceNormalNode.cs.meta
-
0/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/WorldSpaceViewDirectionNode.cs.meta
-
0/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/WorldSpacePositionNode.cs.meta
-
0/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/WorldSpaceNormalNode.cs
|
|||
using UnityEngine.Graphing; |
|||
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
interface IMayRequireWorldPosition |
|||
{ |
|||
bool RequiresWorldPosition(); |
|||
} |
|||
|
|||
[Title("Input/World Space Position Node")] |
|||
public class WorldSpacePositionNode : AbstractMaterialNode, IMayRequireWorldPosition |
|||
{ |
|||
private const int kOutputSlotId = 0; |
|||
|
|||
public override bool hasPreview { get { return true; } } |
|||
|
|||
public override PreviewMode previewMode |
|||
{ |
|||
get { return PreviewMode.Preview3D; } |
|||
} |
|||
|
|||
public WorldSpacePositionNode() |
|||
{ |
|||
name = "World Space Pos"; |
|||
UpdateNodeAfterDeserialization(); |
|||
} |
|||
|
|||
public sealed override void UpdateNodeAfterDeserialization() |
|||
{ |
|||
AddSlot(new MaterialSlot( |
|||
kOutputSlotId, |
|||
ShaderGeneratorNames.WorldSpacePosition, |
|||
ShaderGeneratorNames.WorldSpacePosition, |
|||
SlotType.Output, |
|||
SlotValueType.Vector3, |
|||
Vector4.zero)); |
|||
RemoveSlotsNameNotMatching(new[] { kOutputSlotId }); |
|||
} |
|||
|
|||
public override string GetVariableNameForSlot(int slotId) |
|||
{ |
|||
return ShaderGeneratorNames.WorldSpacePosition; |
|||
} |
|||
|
|||
public bool RequiresWorldPosition() |
|||
{ |
|||
return true; |
|||
} |
|||
} |
|||
} |
|
|||
using System.ComponentModel; |
|||
using UnityEngine.Graphing; |
|||
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
interface IMayRequireViewDirection |
|||
{ |
|||
bool RequiresViewDirection(); |
|||
} |
|||
|
|||
[Title("Input/World Space View Direction Node")] |
|||
public class WorldSpaceViewDirectionNode : AbstractMaterialNode, IMayRequireViewDirection |
|||
{ |
|||
private const int kOutputSlotId = 0; |
|||
|
|||
public override bool hasPreview { get { return true; } } |
|||
public override PreviewMode previewMode |
|||
{ |
|||
get { return PreviewMode.Preview3D; } |
|||
} |
|||
|
|||
public WorldSpaceViewDirectionNode() |
|||
{ |
|||
name = "World View Direction"; |
|||
UpdateNodeAfterDeserialization(); |
|||
} |
|||
|
|||
public sealed override void UpdateNodeAfterDeserialization() |
|||
{ |
|||
AddSlot(new MaterialSlot( |
|||
kOutputSlotId, |
|||
ShaderGeneratorNames.WorldSpaceViewDirection, |
|||
ShaderGeneratorNames.WorldSpaceViewDirection, |
|||
SlotType.Output, |
|||
SlotValueType.Vector3, |
|||
Vector4.zero)); |
|||
RemoveSlotsNameNotMatching(new[] { kOutputSlotId }); |
|||
} |
|||
|
|||
public override string GetVariableNameForSlot(int slotId) |
|||
{ |
|||
return ShaderGeneratorNames.WorldSpaceViewDirection; |
|||
} |
|||
|
|||
public bool RequiresViewDirection() |
|||
{ |
|||
return true; |
|||
} |
|||
} |
|||
} |
|
|||
using System.ComponentModel; |
|||
using UnityEngine.Graphing; |
|||
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
interface IMayRequireViewDirection |
|||
{ |
|||
bool RequiresViewDirection(); |
|||
} |
|||
|
|||
[Title("Input/View Direction Node")] |
|||
public class ViewDirectionNode : AbstractMaterialNode, IMayRequireViewDirection |
|||
{ |
|||
private const int kOutputSlotId = 0; |
|||
private const string kOutputSlotName = "ViewDirection"; |
|||
|
|||
public override bool hasPreview { get { return true; } } |
|||
public override PreviewMode previewMode |
|||
{ |
|||
get { return PreviewMode.Preview3D; } |
|||
} |
|||
|
|||
public ViewDirectionNode() |
|||
{ |
|||
name = "View Direction"; |
|||
UpdateNodeAfterDeserialization(); |
|||
} |
|||
|
|||
public sealed override void UpdateNodeAfterDeserialization() |
|||
{ |
|||
AddSlot(new MaterialSlot(kOutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, SlotValueType.Vector3, Vector4.zero)); |
|||
RemoveSlotsNameNotMatching(new[] { kOutputSlotId }); |
|||
} |
|||
|
|||
public override string GetVariableNameForSlot(int slotId) |
|||
{ |
|||
return "worldViewDir"; |
|||
} |
|||
|
|||
public bool RequiresViewDirection() |
|||
{ |
|||
return true; |
|||
} |
|||
} |
|||
} |
|
|||
using UnityEngine.Graphing; |
|||
|
|||
namespace UnityEngine.MaterialGraph |
|||
{ |
|||
interface IMayRequireWorldPosition |
|||
{ |
|||
bool RequiresWorldPosition(); |
|||
} |
|||
|
|||
[Title("Input/World Pos Node")] |
|||
public class WorldPosNode : AbstractMaterialNode, IMayRequireWorldPosition |
|||
{ |
|||
private const int kOutputSlotId = 0; |
|||
private const string kOutputSlotName = "WorldPos"; |
|||
|
|||
public override bool hasPreview { get { return true; } } |
|||
|
|||
public override PreviewMode previewMode |
|||
{ |
|||
get { return PreviewMode.Preview3D; } |
|||
} |
|||
|
|||
public WorldPosNode() |
|||
{ |
|||
name = "WorldPos"; |
|||
UpdateNodeAfterDeserialization(); |
|||
} |
|||
|
|||
public sealed override void UpdateNodeAfterDeserialization() |
|||
{ |
|||
AddSlot(new MaterialSlot(kOutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, SlotValueType.Vector3, Vector4.zero)); |
|||
RemoveSlotsNameNotMatching(new[] { kOutputSlotId }); |
|||
} |
|||
|
|||
public override string GetVariableNameForSlot(int slotId) |
|||
{ |
|||
return "IN.worldPos"; |
|||
} |
|||
|
|||
public bool RequiresWorldPosition() |
|||
{ |
|||
return true; |
|||
} |
|||
} |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue