浏览代码

Merge with master

/main
Peter Bay Bastian 7 年前
当前提交
0b584564
共有 176 个文件被更改,包括 687 次插入39 次删除
  1. 7
      build.py
  2. 59
      com.unity.shadergraph/Editor/Data/Graphs/AbstractMaterialGraph.cs
  3. 7
      com.unity.shadergraph/Editor/Data/Graphs/BitangentMaterialSlot.cs
  4. 2
      com.unity.shadergraph/Editor/Data/Graphs/MaterialSlot.cs
  5. 8
      com.unity.shadergraph/Editor/Data/Graphs/NormalMaterialSlot.cs
  6. 8
      com.unity.shadergraph/Editor/Data/Graphs/PositionMaterialSlot.cs
  7. 8
      com.unity.shadergraph/Editor/Data/Graphs/TangentMaterialSlot.cs
  8. 7
      com.unity.shadergraph/Editor/Data/Graphs/VertexColorMaterialSlot.cs
  9. 7
      com.unity.shadergraph/Editor/Data/Graphs/ViewDirectionMaterialSlot.cs
  10. 16
      com.unity.shadergraph/Editor/Data/MasterNodes/AlphaMode.cs
  11. 56
      com.unity.shadergraph/Editor/Data/MasterNodes/PBRMasterNode.cs
  12. 44
      com.unity.shadergraph/Editor/Data/MasterNodes/UnlitMasterNode.cs
  13. 5
      com.unity.shadergraph/Editor/Data/Nodes/Artistic/Adjustment/ChannelMixerNode.cs
  14. 5
      com.unity.shadergraph/Editor/Data/Nodes/Artistic/Adjustment/ContrastNode.cs
  15. 5
      com.unity.shadergraph/Editor/Data/Nodes/Artistic/Adjustment/HueNode.cs
  16. 5
      com.unity.shadergraph/Editor/Data/Nodes/Artistic/Adjustment/InvertColorsNode.cs
  17. 5
      com.unity.shadergraph/Editor/Data/Nodes/Artistic/Adjustment/ReplaceColorNode.cs
  18. 5
      com.unity.shadergraph/Editor/Data/Nodes/Artistic/Adjustment/SaturationNode.cs
  19. 5
      com.unity.shadergraph/Editor/Data/Nodes/Artistic/Adjustment/WhiteBalanceNode.cs
  20. 5
      com.unity.shadergraph/Editor/Data/Nodes/Artistic/Blend/BlendNode.cs
  21. 6
      com.unity.shadergraph/Editor/Data/Nodes/Artistic/Filter/DitherNode.cs
  22. 5
      com.unity.shadergraph/Editor/Data/Nodes/Artistic/Mask/ChannelMaskNode.cs
  23. 5
      com.unity.shadergraph/Editor/Data/Nodes/Artistic/Mask/ColorMaskNode.cs
  24. 5
      com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalBlendNode.cs
  25. 5
      com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalCreateNode.cs
  26. 5
      com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalStrengthNode.cs
  27. 5
      com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalUnpackNode.cs
  28. 5
      com.unity.shadergraph/Editor/Data/Nodes/Artistic/Utility/ColorspaceConversion.cs
  29. 5
      com.unity.shadergraph/Editor/Data/Nodes/Channel/CombineNode.cs
  30. 5
      com.unity.shadergraph/Editor/Data/Nodes/Channel/FlipNode.cs
  31. 5
      com.unity.shadergraph/Editor/Data/Nodes/Channel/SplitNode.cs
  32. 15
      com.unity.shadergraph/Editor/Data/Nodes/Channel/SwizzleNode.cs
  33. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/BooleanNode.cs
  34. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs
  35. 8
      com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ConstantNode.cs
  36. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/IntegerNode.cs
  37. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/SliderNode.cs
  38. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/TimeNode.cs
  39. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/Vector1Node.cs
  40. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/Vector2Node.cs
  41. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/Vector3Node.cs
  42. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/Vector4Node.cs
  43. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/BitangentVectorNode.cs
  44. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/NormalVectorNode.cs
  45. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/PositionNode.cs
  46. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/ScreenPositionNode.cs
  47. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/TangentVectorNode.cs
  48. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/UVNode.cs
  49. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/VertexColorNode.cs
  50. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/ViewDirectionNode.cs
  51. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Matrix/Matrix2Node.cs
  52. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Matrix/Matrix3Node.cs
  53. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Matrix/Matrix4Node.cs
  54. 8
      com.unity.shadergraph/Editor/Data/Nodes/Input/Matrix/TransformationMatrixNode.cs
  55. 8
      com.unity.shadergraph/Editor/Data/Nodes/Input/PBR/DielectricSpecularNode.cs
  56. 8
      com.unity.shadergraph/Editor/Data/Nodes/Input/PBR/MetalReflectanceNode.cs
  57. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs
  58. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/AmbientNode.cs
  59. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/CameraNode.cs
  60. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/FogNode.cs
  61. 7
      com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/LightProbeNode.cs
  62. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/ObjectNode.cs
  63. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/ReflectionProbeNode.cs
  64. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/ScreenNode.cs
  65. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CubemapAssetNode.cs
  66. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleCubemapNode.cs
  67. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DNode.cs
  68. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs
  69. 5
      com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs
  70. 36
      com.unity.shadergraph/Editor/Data/Nodes/MasterNode.cs
  71. 2
      com.unity.shadergraph/Editor/Data/Nodes/Math/Basic/MultiplyNode.cs
  72. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Matrix/MatrixConstructionNode.cs
  73. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Matrix/MatrixDeterminantNode.cs
  74. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Matrix/MatrixSplitNode.cs
  75. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Matrix/MatrixTransposeNode.cs
  76. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Round/CeilingNode.cs
  77. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Round/FloorNode.cs
  78. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Round/RoundNode.cs
  79. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Round/SignNode.cs
  80. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Round/StepNode.cs
  81. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Round/TruncateNode.cs
  82. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/ArccosineNode.cs
  83. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/ArcsineNode.cs
  84. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/Arctangent2Node.cs
  85. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/ArctangentNode.cs
  86. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/CosineNode.cs
  87. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/DegreesToRadiansNode.cs
  88. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/HyperbolicCosineNode.cs
  89. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/HyperbolicSineNode.cs
  90. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/HyperbolicTangentNode.cs
  91. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/RadiansToDegreesNode.cs
  92. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/SineNode.cs
  93. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/TangentNode.cs
  94. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/CrossProductNode.cs
  95. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/DistanceNode.cs
  96. 9
      com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/DotProductNode.cs
  97. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/FresnelEffectNode.cs
  98. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/ProjectionNode.cs
  99. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/ReflectionNode.cs
  100. 5
      com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/RejectionNode.cs

7
build.py


def packages_list():
return [
("com.unity.shadergraph", os.path.join("MaterialGraphProject", "Assets", "UnityShaderEditor"))
("com.unity.shadergraph", "com.unity.shadergraph")
unity_package_build.copy_path_to_project(os.path.join("MaterialGraphProject", "Assets", "NewNodes"), repo_path, project_path, logger)
unity_package_build.copy_path_to_project(os.path.join("MaterialGraphProject", "Assets", "TestAssets"), repo_path, project_path, logger)
unity_package_build.copy_path_to_project(os.path.join("MaterialGraphProject", "Assets", "UnityShaderEditor", "Editor", "Testing"), repo_path, project_path, logger)
unity_package_build.copy_path_to_project("TestbedAssets", repo_path, project_path, logger)
unity_package_build.copy_path_to_project("Testing", repo_path, project_path, logger)
if __name__ == "__main__":
import sys

59
com.unity.shadergraph/Editor/Data/Graphs/AbstractMaterialGraph.cs


using System.Text.RegularExpressions;
using UnityEngine;
using UnityEditor.Graphing;
using UnityEditor.Graphing.Util;
namespace UnityEditor.ShaderGraph
{

get { return m_RemovedNodes; }
}
[NonSerialized]
List<INode> m_PastedNodes = new List<INode>();
public IEnumerable<INode> pastedNodes
{
get { return m_PastedNodes; }
}
#endregion
#region Edge data

{
m_AddedNodes.Clear();
m_RemovedNodes.Clear();
m_PastedNodes.Clear();
m_AddedEdges.Clear();
m_RemovedEdges.Clear();
m_AddedProperties.Clear();

public INode GetNodeFromTempId(Identifier tempId)
{
if (tempId.index > m_Nodes.Count)
throw new ArgumentException("Trying to retrieve a node using an identifier that does not exist.");
throw new Exception("Index does not contain a node.");
throw new Exception("Trying to retrieve a node using an identifier that does not exist.");
if (node.tempId.version != tempId.version)
throw new Exception("Trying to retrieve a node that was removed from the graph.");
return node;

outputSlot = outputNode.FindOutputSlot<MaterialSlot>(edge.outputSlot.slotId);
inputSlot = inputNode.FindInputSlot<MaterialSlot>(edge.inputSlot.slotId);
}
if (outputNode == null
|| inputNode == null
|| outputSlot == null

foreach (var edge in other.edges)
ConnectNoValidate(edge.outputSlot, edge.inputSlot);
ValidateGraph();
}
internal void PasteGraph(CopyPasteGraph graphToPaste, List<INode> remappedNodes, List<IEdge> remappedEdges)
{
var nodeGuidMap = new Dictionary<Guid, Guid>();
foreach (var node in graphToPaste.GetNodes<INode>())
{
var oldGuid = node.guid;
var newGuid = node.RewriteGuid();
nodeGuidMap[oldGuid] = newGuid;
var drawState = node.drawState;
var position = drawState.position;
position.x += 30;
position.y += 30;
drawState.position = position;
node.drawState = drawState;
remappedNodes.Add(node);
AddNode(node);
// add the node to the pasted node list
m_PastedNodes.Add(node);
}
// only connect edges within pasted elements, discard
// external edges.
foreach (var edge in graphToPaste.edges)
{
var outputSlot = edge.outputSlot;
var inputSlot = edge.inputSlot;
Guid remappedOutputNodeGuid;
Guid remappedInputNodeGuid;
if (nodeGuidMap.TryGetValue(outputSlot.nodeGuid, out remappedOutputNodeGuid)
&& nodeGuidMap.TryGetValue(inputSlot.nodeGuid, out remappedInputNodeGuid))
{
var outputSlotRef = new SlotReference(remappedOutputNodeGuid, outputSlot.slotId);
var inputSlotRef = new SlotReference(remappedInputNodeGuid, inputSlot.slotId);
remappedEdges.Add(Connect(outputSlotRef, inputSlotRef));
}
}
ValidateGraph();
}

7
com.unity.shadergraph/Editor/Data/Graphs/BitangentMaterialSlot.cs


using System;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEngine.Experimental.UIElements;
namespace UnityEditor.ShaderGraph
{

ShaderStage shaderStage = ShaderStage.Dynamic, bool hidden = false)
: base(slotId, displayName, shaderOutputName, space, shaderStage, hidden)
{}
public override VisualElement InstantiateControl()
{
return new LabelSlotControlView(space + " Space");
}
public override string GetDefaultValue(GenerationMode generationMode)
{

2
com.unity.shadergraph/Editor/Data/Graphs/MaterialSlot.cs


using UnityEditor.Graphing;
using UnityEngine.Experimental.UIElements;
[assembly: InternalsVisibleTo("com.unity.shadergraph.EditorTests")]
[assembly: InternalsVisibleTo("Unity.ShaderGraph.EditorTests")]
namespace UnityEditor.ShaderGraph
{

8
com.unity.shadergraph/Editor/Data/Graphs/NormalMaterialSlot.cs


using System;
using UnityEngine;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEngine.Experimental.UIElements;
namespace UnityEditor.ShaderGraph
{

ShaderStage shaderStage = ShaderStage.Dynamic, bool hidden = false)
: base(slotId, displayName, shaderOutputName, space, shaderStage, hidden)
{}
public override VisualElement InstantiateControl()
{
return new LabelSlotControlView(space + " Space");
}
public override string GetDefaultValue(GenerationMode generationMode)
{

8
com.unity.shadergraph/Editor/Data/Graphs/PositionMaterialSlot.cs


using System;
using UnityEngine;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEngine.Experimental.UIElements;
namespace UnityEditor.ShaderGraph
{

ShaderStage shaderStage = ShaderStage.Dynamic, bool hidden = false)
: base(slotId, displayName, shaderOutputName, space, shaderStage, hidden)
{}
public override VisualElement InstantiateControl()
{
return new LabelSlotControlView(space + " Space");
}
public override string GetDefaultValue(GenerationMode generationMode)
{

8
com.unity.shadergraph/Editor/Data/Graphs/TangentMaterialSlot.cs


using System;
using UnityEngine;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEngine.Experimental.UIElements;
namespace UnityEditor.ShaderGraph
{

ShaderStage shaderStage = ShaderStage.Dynamic, bool hidden = false)
: base(slotId, displayName, shaderOutputName, space, shaderStage, hidden)
{}
public override VisualElement InstantiateControl()
{
return new LabelSlotControlView(space + " Space");
}
public override string GetDefaultValue(GenerationMode generationMode)
{

7
com.unity.shadergraph/Editor/Data/Graphs/VertexColorMaterialSlot.cs


using System;
using UnityEditor.Graphing;
using UnityEngine;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEngine.Experimental.UIElements;
namespace UnityEditor.ShaderGraph
{

ShaderStage shaderStage = ShaderStage.Dynamic, bool hidden = false)
: base(slotId, displayName, shaderOutputName, SlotType.Input, Vector3.zero, shaderStage, hidden)
{}
public override VisualElement InstantiateControl()
{
return new LabelSlotControlView("Vertex Color");
}
public override string GetDefaultValue(GenerationMode generationMode)
{

7
com.unity.shadergraph/Editor/Data/Graphs/ViewDirectionMaterialSlot.cs


using System;
using UnityEngine;
using UnityEditor.ShaderGraph.Drawing.Slots;
using UnityEngine.Experimental.UIElements;
namespace UnityEditor.ShaderGraph
{

ShaderStage shaderStage = ShaderStage.Dynamic, bool hidden = false)
: base(slotId, displayName, shaderOutputName, space, shaderStage, hidden)
{}
public override VisualElement InstantiateControl()
{
return new LabelSlotControlView(space + " Space");
}
public override string GetDefaultValue(GenerationMode generationMode)
{

16
com.unity.shadergraph/Editor/Data/MasterNodes/AlphaMode.cs


using System;
namespace UnityEditor.ShaderGraph {
public enum AlphaMode
namespace UnityEditor.ShaderGraph
{
public enum SurfaceType
AlphaBlend,
AdditiveBlend
Transparent
}
public enum AlphaMode
{
Alpha,
Premultiply,
Additive,
Multiply
}
}

56
com.unity.shadergraph/Editor/Data/MasterNodes/PBRMasterNode.cs


using System;
using System.Linq;
using System.Collections.Generic;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Controls;
using UnityEngine;

[Serializable]
[Title("Master", "PBR")]
public class PBRMasterNode : MasterNode<IPBRSubShader>
public class PBRMasterNode : MasterNode<IPBRSubShader>, IMayRequireNormal
{
public const string AlbedoSlotName = "Albedo";
public const string NormalSlotName = "Normal";

[SerializeField]
private Model m_Model = Model.Metallic;
[EnumControl("")]
[EnumControl("Workflow")]
public Model model
{
get { return m_Model; }

}
[SerializeField]
private SurfaceType m_SurfaceType;
[EnumControl("Surface")]
public SurfaceType surfaceType
{
get { return m_SurfaceType; }
set
{
if (m_SurfaceType == value)
return;
m_SurfaceType = value;
Dirty(ModificationScope.Graph);
}
}
[SerializeField]
[EnumControl("")]
[EnumControl("Blend")]
public AlphaMode alphaMode
{
get { return m_AlphaMode; }

}
}
[SerializeField]
private bool m_TwoSided;
[ToggleControl("Two Sided")]
public Toggle twoSided
{
get { return new Toggle(m_TwoSided); }
set
{
if (m_TwoSided == value.isOn)
return;
m_TwoSided = value.isOn;
Dirty(ModificationScope.Graph);
}
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/PBR-Master-Node"; }
}
base.UpdateNodeAfterDeserialization();
AddSlot(new Vector3MaterialSlot(NormalSlotId, NormalSlotName, NormalSlotName, SlotType.Input, new Vector3(0, 0, 1), ShaderStage.Fragment));
AddSlot(new NormalMaterialSlot(NormalSlotId, NormalSlotName, NormalSlotName, CoordinateSpace.Tangent, ShaderStage.Fragment));
AddSlot(new ColorRGBMaterialSlot(EmissionSlotId, EmissionSlotName, EmissionSlotName, SlotType.Input, Color.black, ShaderStage.Fragment));
if (model == Model.Metallic)
AddSlot(new Vector1MaterialSlot(MetallicSlotId, MetallicSlotName, MetallicSlotName, SlotType.Input, 0, ShaderStage.Fragment));

AlphaSlotId,
AlphaThresholdSlotId
}, true);
}
if (!subShaders.Any())
AddSubShader(new LightWeightPBRSubShader());
public NeededCoordinateSpace RequiresNormal()
{
List<ISlot> slots = new List<ISlot>();
GetSlots(slots);
return slots.OfType<IMayRequireNormal>().Aggregate(NeededCoordinateSpace.None, (mask, node) => mask | node.RequiresNormal());
}
}
}

44
com.unity.shadergraph/Editor/Data/MasterNodes/UnlitMasterNode.cs


[SerializeField]
private SurfaceType m_SurfaceType;
[EnumControl("Surface")]
public SurfaceType surfaceType
{
get { return m_SurfaceType; }
set
{
if (m_SurfaceType == value)
return;
m_SurfaceType = value;
Dirty(ModificationScope.Graph);
}
}
[SerializeField]
[EnumControl("")]
[EnumControl("Blend")]
public AlphaMode alphaMode
{
get { return m_AlphaMode; }

}
}
[SerializeField]
private bool m_TwoSided;
[ToggleControl("Two Sided")]
public Toggle twoSided
{
get { return new Toggle(m_TwoSided); }
set
{
if (m_TwoSided == value.isOn)
return;
m_TwoSided = value.isOn;
Dirty(ModificationScope.Graph);
}
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Unlit-Master-Node"; }
}
base.UpdateNodeAfterDeserialization();
name = "Unlit Master";
AddSlot(new ColorRGBMaterialSlot(ColorSlotId, ColorSlotName, ColorSlotName, SlotType.Input, Color.grey, ShaderStage.Fragment));
AddSlot(new Vector1MaterialSlot(AlphaSlotId, AlphaSlotName, AlphaSlotName, SlotType.Input, 1, ShaderStage.Fragment));

AlphaSlotId,
AlphaThresholdSlotId
});
if (!subShaders.Any())
AddSubShader(new LightWeightUnlitSubShader());
}
}
}

5
com.unity.shadergraph/Editor/Data/Nodes/Artistic/Adjustment/ChannelMixerNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Channel-Mixer-Node"; }
}
const int InputSlotId = 0;
const int OutputSlotId = 1;
const string kInputSlotName = "In";

5
com.unity.shadergraph/Editor/Data/Nodes/Artistic/Adjustment/ContrastNode.cs


name = "Contrast";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Contrast-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Contrast", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Artistic/Adjustment/HueNode.cs


name = "Hue";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Hue-Node"; }
}
[SerializeField]
private HueMode m_HueMode = HueMode.Degrees;

5
com.unity.shadergraph/Editor/Data/Nodes/Artistic/Adjustment/InvertColorsNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Invert-Colors-Node"; }
}
const int InputSlotId = 0;
const int OutputSlotId = 1;
const string kInputSlotName = "In";

5
com.unity.shadergraph/Editor/Data/Nodes/Artistic/Adjustment/ReplaceColorNode.cs


name = "Replace Color";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Replace-Color-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_ReplaceColor", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Artistic/Adjustment/SaturationNode.cs


name = "Saturation";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Saturation-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Saturation", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Artistic/Adjustment/WhiteBalanceNode.cs


name = "White Balance";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/White-Balance-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_WhiteBalance", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Artistic/Blend/BlendNode.cs


name = "Blend";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Blend-Node"; }
}
string GetCurrentBlendName()
{
return System.Enum.GetName(typeof(BlendMode), m_BlendMode);

6
com.unity.shadergraph/Editor/Data/Nodes/Artistic/Filter/DitherNode.cs


name = "Dither";
UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Dither-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Dither", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Artistic/Mask/ChannelMaskNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Channel-Mask-Node"; }
}
const int InputSlotId = 0;
const int OutputSlotId = 1;
const string kInputSlotName = "In";

5
com.unity.shadergraph/Editor/Data/Nodes/Artistic/Mask/ColorMaskNode.cs


name = "Color Mask";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Color-Mask-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_ColorMask", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalBlendNode.cs


name = "Normal Blend";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Normal-Blend-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_NormalBlend", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalCreateNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Normal-Create-Node"; }
}
string GetFunctionName()
{
return string.Format("Unity_NormalCreate_{0}", precision);

5
com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalStrengthNode.cs


name = "Normal Strength";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Normal-Strength-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_NormalStrength", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Artistic/Normal/NormalUnpackNode.cs


name = "Normal Unpack";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Normal-Unpack-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_NormalUnpack", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Artistic/Utility/ColorspaceConversion.cs


name = "Colorspace Conversion";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Colorspace-Conversion-Node"; }
}
[SerializeField]
ColorspaceConversion m_Conversion = new ColorspaceConversion(Colorspace.RGB, Colorspace.RGB);

5
com.unity.shadergraph/Editor/Data/Nodes/Channel/CombineNode.cs


name = "Combine";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Combine-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Combine", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Channel/FlipNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Flip-Node"; }
}
const int InputSlotId = 0;
const int OutputSlotId = 1;
const string kInputSlotName = "In";

5
com.unity.shadergraph/Editor/Data/Nodes/Channel/SplitNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Split-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new DynamicVectorMaterialSlot(InputSlotId, kInputSlotName, kInputSlotName, SlotType.Input, Vector4.zero));

15
com.unity.shadergraph/Editor/Data/Nodes/Channel/SwizzleNode.cs


using System;
using System.Collections.Generic;
using System.Globalization;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Controls;
using UnityEngine;

{
name = "Swizzle";
UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Swizzle-Node"; }
}
const int InputSlotId = 0;

if (inputValueType == ConcreteSlotValueType.Vector1)
visitor.AddShaderChunk(string.Format("{0} {1} = {2};", outputSlotType, outputName, inputValue), false);
else if (generationMode == GenerationMode.ForReals)
visitor.AddShaderChunk(string.Format("{0} {1} = {2}.{3}{4}{5}{6};", outputSlotType, outputName, inputValue, s_ComponentList[m_RedChannel], s_ComponentList[m_GreenChannel], s_ComponentList[m_BlueChannel], s_ComponentList[m_AlphaChannel]), false);
visitor.AddShaderChunk(string.Format("{0} {1} = {2}.{3}{4}{5}{6};",
outputSlotType,
outputName,
inputValue,
s_ComponentList[m_RedChannel].ToString(CultureInfo.InvariantCulture),
s_ComponentList[m_GreenChannel].ToString(CultureInfo.InvariantCulture),
s_ComponentList[m_BlueChannel].ToString(CultureInfo.InvariantCulture),
s_ComponentList[m_AlphaChannel].ToString(CultureInfo.InvariantCulture)), false);
else
visitor.AddShaderChunk(string.Format("{0} {1} = {0}({3}[((int){2} >> 0) & 3], {3}[((int){2} >> 2) & 3], {3}[((int){2} >> 4) & 3], {3}[((int){2} >> 6) & 3]);",
outputSlotType,

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/BooleanNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Boolean-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new BooleanMaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, false));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ColorNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Color-Node"; }
}
[SerializeField]
Color m_Color = new Color(UnityEngine.Color.clear, ColorMode.Default);

8
com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/ConstantNode.cs


using System.Collections.Generic;
using System.Globalization;
using UnityEditor.ShaderGraph.Drawing.Controls;
using UnityEngine;
using UnityEditor.Graphing;

UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Constant-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector1MaterialSlot(kOutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, 0));

public void GenerateNodeCode(ShaderGenerator visitor, GenerationMode generationMode)
{
visitor.AddShaderChunk(precision + " " + GetVariableNameForNode() + " = " + m_constantList[constant] + ";", true);
visitor.AddShaderChunk(precision + " " + GetVariableNameForNode() + " = " + m_constantList[constant].ToString(CultureInfo.InvariantCulture) + ";", true);
}
public override string GetVariableNameForSlot(int slotId)

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/IntegerNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Integer-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector1MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, 0));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/SliderNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Slider-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector1MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, 0));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/TimeNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Time-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector1MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, 0));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/Vector1Node.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Vector-1-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector1MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, 0));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/Vector2Node.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Vector-2-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector2MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, Vector4.zero));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/Vector3Node.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Vector-3-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector3MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, Vector4.zero));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Basic/Vector4Node.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Vector-4-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector4MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, Vector4.zero));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/BitangentVectorNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Bitangent-Vector-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector3MaterialSlot(kOutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, new Vector4(0, 0, 1)));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/NormalVectorNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Normal-Vector-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector3MaterialSlot(kOutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, new Vector4(0, 0, 1)));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/PositionNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Position-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector3MaterialSlot(

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/ScreenPositionNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Screen-Position-Node"; }
}
[SerializeField]
private ScreenSpaceType m_ScreenSpaceType = ScreenSpaceType.Default;

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/TangentVectorNode.cs


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)));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/UVNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/UV-Node"; }
}
public override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector4MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, Vector2.zero));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/VertexColorNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Vertex-Color-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector4MaterialSlot(kOutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, Vector4.one));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Geometry/ViewDirectionNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/View-Direction-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector3MaterialSlot(

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Matrix/Matrix2Node.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Matrix-2x2-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Matrix2MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Matrix/Matrix3Node.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Matrix-3x3-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Matrix3MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Matrix/Matrix4Node.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Matrix-4x4-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Matrix4MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output));

8
com.unity.shadergraph/Editor/Data/Nodes/Input/Matrix/TransformationMatrixNode.cs


using UnityEditor.Graphing;
using System.Collections.Generic;
using System.Globalization;
using UnityEditor.ShaderGraph.Drawing.Controls;
using UnityEngine;

UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Transformation-Matrix-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Matrix4MaterialSlot(kOutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output));

public override string GetVariableNameForSlot(int slotId)
{
return m_matrixList[matrix];
return m_matrixList[matrix].ToString(CultureInfo.InvariantCulture);
}
public bool RequiresVertexColor()

8
com.unity.shadergraph/Editor/Data/Nodes/Input/PBR/DielectricSpecularNode.cs


using System;
using System.Collections.Generic;
using System.Globalization;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Controls;
using UnityEngine;

{
name = "Dielectric Specular";
UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Dielectric-Specular-Node"; }
}
[SerializeField]

sb.AppendLine("{0}3 {1} = pow(_{2}_IOR - 1, 2) / pow(_{2}_IOR + 1, 2);", precision, GetVariableNameForSlot(kOutputSlotId), GetVariableNameForNode());
break;
default:
sb.AppendLine("{0}3 {1} = {0}3{2};", precision, GetVariableNameForSlot(kOutputSlotId), m_MaterialList[material.type]);
sb.AppendLine("{0}3 {1} = {0}3{2};", precision, GetVariableNameForSlot(kOutputSlotId), m_MaterialList[material.type].ToString(CultureInfo.InvariantCulture));
break;
}
visitor.AddShaderChunk(sb.ToString(), false);

8
com.unity.shadergraph/Editor/Data/Nodes/Input/PBR/MetalReflectanceNode.cs


using System.Collections.Generic;
using System.Globalization;
using UnityEngine;
using UnityEditor.Graphing;
using UnityEditor.ShaderGraph.Drawing.Controls;

{
name = "Metal Reflectance";
UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Metal-Reflectance-Node"; }
}
[SerializeField]

public void GenerateNodeCode(ShaderGenerator visitor, GenerationMode generationMode)
{
visitor.AddShaderChunk(string.Format("{0}3 {1} = {0}3{2};", precision, GetVariableNameForSlot(kOutputSlotId), m_MaterialList[material]), true);
visitor.AddShaderChunk(string.Format("{0}3 {1} = {0}3{2};", precision, GetVariableNameForSlot(kOutputSlotId), m_MaterialList[material].ToString(CultureInfo.InvariantCulture)), true);
}
}
}

5
com.unity.shadergraph/Editor/Data/Nodes/Input/PropertyNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Property-Node"; }
}
private void UpdateNode()
{
var graph = owner as AbstractMaterialGraph;

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/AmbientNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Ambient-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new ColorRGBMaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, Vector4.zero));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/CameraNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Camera-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector3MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, Vector3.zero));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/FogNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Fog-Node"; }
}
const int OutputSlotId = 0;
const int OutputSlot1Id = 1;
const string k_OutputSlotName = "Color";

7
com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/LightProbeNode.cs


name = "Light Probe";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Light-Probe-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_LightProbe", BindingFlags.Static | BindingFlags.NonPublic);

return
@"
{
Out = ShadeSH9(float4(Normal , 1));
Out = SampleSH(Normal);
}
";
}

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/ObjectNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Object-Node"; }
}
public override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector3MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, Vector3.zero));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/ReflectionProbeNode.cs


name = "Reflection Probe";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Reflection-Probe-Node"; }
}
public override PreviewMode previewMode
{
get

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/ScreenNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Screen-Node"; }
}
public override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector1MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, 0));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/CubemapAssetNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Cubemap-Asset-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new CubemapMaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleCubemapNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Sample-Cubemap-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Vector4MaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, Vector4.zero));

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SampleTexture2DNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Sample-Texture-2D-Node"; }
}
[SerializeField]
private TextureType m_TextureType = TextureType.Default;

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/SamplerStateNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Sampler-State-Node"; }
}
public override bool hasPreview { get { return false; } }
private const int kOutputSlotId = 0;

5
com.unity.shadergraph/Editor/Data/Nodes/Input/Texture/Texture2DAssetNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Texture-2D-Asset-Node"; }
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new Texture2DMaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output));

36
com.unity.shadergraph/Editor/Data/Nodes/MasterNode.cs


using System.Collections.Generic;
using System.Linq;
using UnityEditor.Graphing;
using UnityEditor.Graphing.Util;
using UnityEngine;
namespace UnityEditor.ShaderGraph

{
get { return typeof(T); }
}
public IEnumerable<T> subShaders
{
get { return m_SubShaders; }

{
if (m_SubShaders.Contains(subshader))
return;
return;
Dirty(ModificationScope.Node);
Dirty(ModificationScope.Graph);
Dirty(ModificationScope.Node);
Dirty(ModificationScope.Graph);
}
public string GetShader(GenerationMode mode, string outputName, out List<PropertyCollector.TextureInfo> configuredTextures)

public override void OnAfterDeserialize()
{
base.OnAfterDeserialize();
base.OnAfterDeserialize();
}
public override void UpdateNodeAfterDeserialization()
{
base.UpdateNodeAfterDeserialization();
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
foreach (var type in assembly.GetTypesOrNothing())
{
var isValid = !type.IsAbstract && type.IsPublic && !type.IsGenericType && type.IsClass && typeof(T).IsAssignableFrom(type);
if (isValid && !subShaders.Any(s => s.GetType() == type))
{
try
{
var subShader = (T)Activator.CreateInstance(type);
AddSubShader(subShader);
}
catch (Exception e)
{
Debug.LogException(e);
}
}
}
}
}
}
}

2
com.unity.shadergraph/Editor/Data/Nodes/Math/Basic/MultiplyNode.cs


public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(new DynamicValueMaterialSlot(Input1SlotId, kInput1SlotName, kInput1SlotName, SlotType.Input, Matrix4x4.zero));
AddSlot(new DynamicValueMaterialSlot(Input2SlotId, kInput2SlotName, kInput2SlotName, SlotType.Input, new Matrix4x4(new Vector4(2,2,2,2), Vector4.zero, Vector4.zero, Vector4.zero)));
AddSlot(new DynamicValueMaterialSlot(Input2SlotId, kInput2SlotName, kInput2SlotName, SlotType.Input, new Matrix4x4(new Vector4(2,2,2,2), new Vector4(2,2,2,2), new Vector4(2,2,2,2), new Vector4(2,2,2,2))));
AddSlot(new DynamicValueMaterialSlot(OutputSlotId, kOutputSlotName, kOutputSlotName, SlotType.Output, Matrix4x4.zero));
RemoveSlotsNameNotMatching(new[] { Input1SlotId, Input2SlotId, OutputSlotId });
}

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Matrix/MatrixConstructionNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Matrix-Construction-Node"; }
}
[SerializeField]
MatrixAxis m_Axis;

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Matrix/MatrixDeterminantNode.cs


name = "Matrix Determinant";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Matrix-Determinant-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_MatrixDeterminant", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Matrix/MatrixSplitNode.cs


UpdateNodeAfterDeserialization();
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Matrix-Split-Node"; }
}
[SerializeField]
MatrixAxis m_Axis;

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Matrix/MatrixTransposeNode.cs


name = "Matrix Transpose";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Matrix-Transpose-Node"; }
}
public override bool hasPreview
{
get { return false; }

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Round/CeilingNode.cs


name = "Ceiling";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Ceiling-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Ceiling", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Round/FloorNode.cs


name = "Floor";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Floor-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Floor", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Round/RoundNode.cs


name = "Round";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Round-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Round", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Round/SignNode.cs


name = "Sign";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Sign-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Sign", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Round/StepNode.cs


name = "Step";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Step-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Step", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Round/TruncateNode.cs


name = "Truncate";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Truncate-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Truncate", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/ArccosineNode.cs


name = "Arccosine";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Arccosine-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Arccosine", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/ArcsineNode.cs


name = "Arcsine";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Arcsine-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Arcsine", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/Arctangent2Node.cs


name = "Arctangent2";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Arctangent2-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Arctangent2", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/ArctangentNode.cs


name = "Arctangent";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Arctangent-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Arctangent", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/CosineNode.cs


name = "Cosine";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Cosine-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Cosine", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/DegreesToRadiansNode.cs


name = "Degrees To Radians";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Degrees-To-Radians-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_DegreesToRadians", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/HyperbolicCosineNode.cs


name = "Hyperbolic Cosine";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Hyperbolic-Cosine-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_HyperbolicCosine", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/HyperbolicSineNode.cs


name = "Hyperbolic Sine";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Hyperbolic-Sine-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_HyperbolicSine", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/HyperbolicTangentNode.cs


name = "Hyperbolic Tangent";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Hyperbolic-Tangent-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_HyperbolicTangent", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/RadiansToDegreesNode.cs


name = "Radians To Degrees";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Radians-To-Degrees-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_RadiansToDegrees", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/SineNode.cs


name = "Sine";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Sine-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Sine", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Trigonometry/TangentNode.cs


name = "Tangent";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Tangent-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Tangent", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/CrossProductNode.cs


name = "Cross Product";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Cross-Product-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_CrossProduct", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/DistanceNode.cs


name = "Distance";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Distance-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Distance", BindingFlags.Static | BindingFlags.NonPublic);

9
com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/DotProductNode.cs


name = "Dot Product";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Dot-Product-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_DotProduct", BindingFlags.Static | BindingFlags.NonPublic);

[Slot(0, Binding.None, 0, 0, 0, 0)] Vector3 A,
[Slot(1, Binding.None, 0, 1, 0, 0)] Vector3 B,
[Slot(0, Binding.None, 0, 0, 0, 0)] DynamicDimensionVector A,
[Slot(1, Binding.None, 0, 1, 0, 0)] DynamicDimensionVector B,
[Slot(2, Binding.None)] out Vector1 Out)
{
return

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/FresnelEffectNode.cs


name = "Fresnel Effect";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Fresnel-Effect-Node"; }
}
public override PreviewMode previewMode
{
get { return PreviewMode.Preview3D; }

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/ProjectionNode.cs


name = "Projection";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Projection-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Projection", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/ReflectionNode.cs


name = "Reflection";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Reflection-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Reflection", BindingFlags.Static | BindingFlags.NonPublic);

5
com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/RejectionNode.cs


name = "Rejection";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Rejection-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Rejection", BindingFlags.Static | BindingFlags.NonPublic);

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存