浏览代码

Merge branch 'hackweek2017' of https://github.com/stramit/MaterialGraph into hackweek2017

/main
Eduardo Chaves 8 年前
当前提交
5eca2dca
共有 108 个文件被更改,包括 2434 次插入229 次删除
  1. 4
      MaterialGraphProject/Assets/Brandon/HexNode.cs
  2. 182
      MaterialGraphProject/Assets/Matt&Andre/RemapNode.cs
  3. 8
      MaterialGraphProject/Assets/Rinaldo/BlendModeNode.cs
  4. 2
      MaterialGraphProject/Assets/Rinaldo/BlendModesEnum.cs
  5. 2
      MaterialGraphProject/Assets/TestAssets/Sky1.jpg.meta
  6. 3
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/NodePreviewPresenter.cs
  7. 97
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/HelperShader.shader
  8. 6
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/HelperShader.shader.meta
  9. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Templates/2DPreview.template
  10. 2
      MaterialGraphProject/Assets/Vlad/UVRotatorNode.cs
  11. 52
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Texture/CubemapNode.cs
  12. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/SceneData/DepthTextureNode.cs
  13. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/SceneData/MotionVectorTextureNode.cs
  14. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector4Node.cs
  15. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Time/SinTimeNode.cs
  16. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Time/TimeNode.cs
  17. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector1Node.cs
  18. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector2Node.cs
  19. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector3Node.cs
  20. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/ColorNode.cs
  21. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/SceneData/ScreenPosNode.cs
  22. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpacePositionNode.cs
  23. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpaceViewDirectionNode.cs
  24. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpaceNormalNode.cs
  25. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpaceTangentNode.cs
  26. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpaceBitangentNode.cs
  27. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/VertexColorNode.cs
  28. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/UVNode.cs
  29. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Texture/TextureNode.cs
  30. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Texture/TextureLODNode.cs
  31. 9
      MaterialGraphProject/Assets/Andre.meta
  32. 71
      MaterialGraphProject/Assets/Brandon/LineNode.cs
  33. 12
      MaterialGraphProject/Assets/Brandon/LineNode.cs.meta
  34. 43
      MaterialGraphProject/Assets/Matt/LinearToRGB.cs
  35. 12
      MaterialGraphProject/Assets/Matt/LinearToRGB.cs.meta
  36. 43
      MaterialGraphProject/Assets/Matt/RGBtoLinear.cs
  37. 12
      MaterialGraphProject/Assets/Matt/RGBtoLinear.cs.meta
  38. 1
      MaterialGraphProject/Assets/TestGraph.ShaderGraph
  39. 9
      MaterialGraphProject/Assets/TestGraph.ShaderGraph.meta
  40. 110
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/UnitTests/Function4InputTests.cs
  41. 12
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/UnitTests/Function4InputTests.cs.meta
  42. 145
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Function4Input.cs
  43. 12
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Function4Input.cs.meta
  44. 9
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input.meta
  45. 9
      MaterialGraphProject/Assets/Andre/New Shader Graph.ShaderGraph.meta
  46. 363
      MaterialGraphProject/Assets/Andre/Andre_scene.unity
  47. 8
      MaterialGraphProject/Assets/Andre/Andre_scene.unity.meta
  48. 87
      MaterialGraphProject/Assets/Andre/New Material.mat
  49. 9
      MaterialGraphProject/Assets/Andre/New Material.mat.meta
  50. 1
      MaterialGraphProject/Assets/Andre/New Shader Graph.ShaderGraph
  51. 9
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry.meta
  52. 9
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/SceneData.meta
  53. 9
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Texture.meta
  54. 12
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Texture/CubemapNode.cs.meta
  55. 9
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Time.meta
  56. 9
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector.meta
  57. 25
      MaterialGraphProject/obj/Debug/Assembly-CSharp.csproj.FilesWrittenAbsolute.txt
  58. 1001
      MaterialGraphProject/obj/Debug/Assembly-CSharp.dll
  59. 171
      MaterialGraphProject/obj/Debug/Assembly-CSharp.dll.mdb
  60. 8
      MaterialGraphProject/Assets/Matt&Andre/CubemapNode.cs.meta
  61. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Texture/CubemapNode.cs
  62. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/SceneData/DepthTextureNode.cs
  63. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/SceneData/MotionVectorTextureNode.cs
  64. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/SceneData/MotionVectorTextureNode.cs.meta
  65. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/SceneData/DepthTextureNode.cs.meta
  66. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector4Node.cs
  67. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector4Node.cs.meta
  68. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/ColorNode.cs.meta
  69. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/SceneData/ScreenPosNode.cs.meta
  70. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Time/SinTimeNode.cs
  71. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Time/SinTimeNode.cs.meta
  72. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Texture/TextureNode.cs.meta
  73. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Time/TimeNode.cs
  74. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Time/TimeNode.cs.meta
  75. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/UVNode.cs.meta
  76. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector1Node.cs
  77. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector1Node.cs.meta
  78. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector2Node.cs
  79. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector2Node.cs.meta
  80. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector3Node.cs
  81. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector3Node.cs.meta
  82. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/ColorNode.cs
  83. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/SceneData/ScreenPosNode.cs
  84. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpacePositionNode.cs
  85. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpaceViewDirectionNode.cs
  86. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpaceNormalNode.cs.meta
  87. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpaceViewDirectionNode.cs.meta
  88. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpacePositionNode.cs.meta
  89. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpaceNormalNode.cs
  90. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpaceTangentNode.cs
  91. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpaceTangentNode.cs.meta

4
MaterialGraphProject/Assets/Brandon/HexNode.cs


protected override MaterialSlot GetInputSlot1()
{
return new MaterialSlot(InputSlot1Id, GetInputSlot1Name(), kInputSlot1ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Dynamic, Vector4.zero);
return new MaterialSlot(InputSlot1Id, GetInputSlot1Name(), kInputSlot1ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Vector2, Vector2.zero);
}
protected override string GetInputSlot2Name()

protected override MaterialSlot GetInputSlot2()
{
return new MaterialSlot(InputSlot2Id, GetInputSlot2Name(), kInputSlot2ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Vector1, Vector4.zero);
return new MaterialSlot(InputSlot2Id, GetInputSlot2Name(), kInputSlot2ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Vector1, Vector2.zero);
}
protected override MaterialSlot GetOutputSlot()

182
MaterialGraphProject/Assets/Matt&Andre/RemapNode.cs


namespace UnityEngine.MaterialGraph
{
[Title ("Math/Range/Remap")]
public class RemapNode : Function2Input, IGeneratesFunction
public class RemapNode : AbstractMaterialNode, IGeneratesBodyCode, IGeneratesFunction
/*protected const string kInputSlot1ShaderName = "Input1";
protected const string kInputSlot2ShaderName = "Input2";
protected const string kInputSlot1ShaderName = "Input1";
protected const string kInputSlot2ShaderName = "InMinMax";
protected const string kInputSlot3ShaderName = "OutMinMax";
public const int OutputSlotId = 2;
public const int InputSlot3Id = 2;
public const int OutputSlotId = 3;
*/
public override bool hasPreview
{
get { return true; }
}
name = "RemapNode";
//UpdateNodeAfterDeserialization ();
name = "Remap";
protected override string GetFunctionName ()
public string GetFunctionName ()
//need to override the type of slot two somehow///////////////////////////////////////////////////
/*override MaterialSlot GetInputSlot2 ()
public sealed override void UpdateNodeAfterDeserialization()
return new MaterialSlot (InputSlot2Id, GetInputSlot2Name (), kInputSlot2ShaderName, SlotType.Input, SlotValueType.Vector4, Vector4.zero);
}*/
AddSlot(GetInputSlot1());
AddSlot(GetInputSlot2());
AddSlot(GetInputSlot3());
AddSlot(GetOutputSlot());
RemoveSlotsNameNotMatching(validSlots);
}
public void GenerateNodeFunction (ShaderGenerator visitor, GenerationMode generationMode)
protected int[] validSlots
var outputString = new ShaderGenerator ();
outputString.AddShaderChunk (GetFunctionPrototype ("arg1", "arg2"), false);
outputString.AddShaderChunk ("{", false);
outputString.Indent ();
outputString.AddShaderChunk ("return ((arg1 * (arg2.y - arg2.x)) * (arg2.w - arg2.z))+arg2.z;", false);
outputString.Deindent ();
outputString.AddShaderChunk ("}", false);
visitor.AddShaderChunk (outputString.GetShaderString (0), true);
get { return new[] {InputSlot1Id, InputSlot2Id, InputSlot3Id, OutputSlotId}; }
/*
public sealed override void UpdateNodeAfterDeserialization ()
protected virtual MaterialSlot GetInputSlot1()
AddSlot (GetInputSlot1 ());
AddSlot (GetInputSlot2 ());
AddSlot (GetOutputSlot ());
RemoveSlotsNameNotMatching (validSlots);
return new MaterialSlot(InputSlot1Id, GetInputSlot1Name(), kInputSlot1ShaderName, SlotType.Input, SlotValueType.Dynamic, Vector4.zero);
protected int[] validSlots {
get { return new[] { InputSlot1Id, InputSlot2Id, OutputSlotId }; }
protected virtual MaterialSlot GetInputSlot2()
{
return new MaterialSlot(InputSlot2Id, GetInputSlot2Name(), kInputSlot2ShaderName, SlotType.Input, SlotValueType.Vector2, Vector2.zero);
protected virtual MaterialSlot GetInputSlot1 ()
protected virtual MaterialSlot GetInputSlot3()
return new MaterialSlot (InputSlot1Id, GetInputSlot1Name (), kInputSlot1ShaderName, SlotType.Input, SlotValueType.Dynamic, Vector4.zero);
return new MaterialSlot(InputSlot3Id, GetInputSlot3Name(), kInputSlot3ShaderName, SlotType.Input, SlotValueType.Vector2, Vector2.zero);
protected virtual MaterialSlot GetInputSlot2 ()
protected virtual MaterialSlot GetOutputSlot()
return new MaterialSlot (InputSlot2Id, GetInputSlot2Name (), kInputSlot2ShaderName, SlotType.Input, SlotValueType.Vector4, Vector4.zero);
return new MaterialSlot(OutputSlotId, GetOutputSlotName(), kOutputSlotShaderName, SlotType.Output, SlotValueType.Dynamic, Vector4.zero);
protected virtual MaterialSlot GetOutputSlot ()
protected virtual string GetInputSlot1Name()
return new MaterialSlot (OutputSlotId, GetOutputSlotName (), kOutputSlotShaderName, SlotType.Output, SlotValueType.Dynamic, Vector4.zero);
return "Input";
protected virtual string GetInputSlot1Name ()
protected virtual string GetInputSlot2Name()
return "Input1";
return "InMinMax";
protected virtual string GetInputSlot2Name ()
protected virtual string GetInputSlot3Name()
return "RemapVector";
return "OutMinMax";
protected virtual string GetOutputSlotName ()
protected virtual string GetOutputSlotName()
//protected abstract string GetFunctionName ();
/*protected virtual string GetFunctionPrototype (string arg1Name, string arg2Name)
protected virtual string GetFunctionPrototype(string arg1Name, string arg2Name, string arg3Name)
return "inline " + precision + outputDimension + " " + GetFunctionName () + " ("
+ precision + input1Dimension + " " + arg1Name + ", "
+ precision + input2Dimension + " " + arg2Name + ")";
}
public void GenerateNodeCode (ShaderGenerator visitor, GenerationMode generationMode)
{
NodeUtils.SlotConfigurationExceptionIfBadConfiguration (this, new[] { InputSlot1Id, InputSlot2Id }, new[] { OutputSlotId });
string input1Value = GetSlotValue (InputSlot1Id, generationMode);
string input2Value = GetSlotValue (InputSlot2Id, generationMode);
visitor.AddShaderChunk (precision + outputDimension + " " + GetVariableNameForSlot (OutputSlotId) + " = " + GetFunctionCallBody (input1Value, input2Value) + ";", true);
return "inline " + precision + outputDimension + " " + GetFunctionName() + " ("
+ precision + input1Dimension + " " + arg1Name + ", "
+ precision + input2Dimension + " " + arg2Name + ", "
+ precision + input3Dimension + " " + arg3Name + ")";
protected virtual string GetFunctionCallBody (string input1Value, string input2Value)
public void GenerateNodeCode(ShaderGenerator visitor, GenerationMode generationMode)
return GetFunctionName () + " (" + input1Value + ", " + input2Value + ")";
}*/
NodeUtils.SlotConfigurationExceptionIfBadConfiguration(this, new[] { InputSlot1Id, InputSlot2Id, InputSlot3Id }, new[] { OutputSlotId });
string input1Value = GetSlotValue(InputSlot1Id, generationMode);
string input2Value = GetSlotValue(InputSlot2Id, generationMode);
string input3Value = GetSlotValue(InputSlot3Id, generationMode);
/*public string outputDimension {
get { return ConvertConcreteSlotValueTypeToString (FindOutputSlot<MaterialSlot> (OutputSlotId).concreteValueType); }
visitor.AddShaderChunk(precision + outputDimension + " " + GetVariableNameForSlot(OutputSlotId) + " = " + GetFunctionCallBody(input1Value, input2Value, input3Value) + ";", true);
private string input1Dimension {
get { return ConvertConcreteSlotValueTypeToString (FindInputSlot<MaterialSlot> (InputSlot1Id).concreteValueType); }
}
private string input2Dimension {
get { return ConvertConcreteSlotValueTypeToString (FindInputSlot<MaterialSlot> (InputSlot2Id).concreteValueType); }
}*/
public void GenerateNodeFunction(ShaderGenerator visitor, GenerationMode generationMode)
{
var outputString = new ShaderGenerator ();
outputString.AddShaderChunk (GetFunctionPrototype ("arg1", "arg2", "arg3"), false);
outputString.AddShaderChunk ("{", false);
outputString.Indent ();
outputString.AddShaderChunk ("return arg1 * ((arg3.y - arg3.x) / (arg2.y - arg2.x)) + arg3.x;", false);
outputString.Deindent ();
outputString.AddShaderChunk ("}", false);
/// <summary>
/// Gets the type of the property.*/
/// </summary>
/// <value>The type of the property.</value>
/*public override PropertyType propertyType {
get { return PropertyType.Vector4; }
visitor.AddShaderChunk (outputString.GetShaderString (0), true);
public Vector4 value {
get { return m_Value; }
set {
if (m_Value == value)
return;
m_Value = value;
if (onModified != null)
onModified (this, ModificationScope.Node);
}
}*/
/*public override void GeneratePropertyBlock (PropertyGenerator visitor, GenerationMode generationMode)
protected virtual string GetFunctionCallBody(string inputValue1, string inputValue2, string inputValue3)
if (exposedState == ExposedState.Exposed)
visitor.AddShaderProperty (new VectorPropertyChunk (propertyName, description, m_Value, PropertyChunk.HideState.Visible));
return GetFunctionName() + " (" + inputValue1 + ", " + inputValue2 + ", " + inputValue3 + ")";
public override void GeneratePropertyUsages (ShaderGenerator visitor, GenerationMode generationMode)
public string outputDimension
if (exposedState == ExposedState.Exposed || generationMode.IsPreview ())
visitor.AddShaderChunk (precision + "3 " + propertyName + ";", false);
}*/
/*public void GenerateNodeCode (ShaderGenerator visitor, GenerationMode generationMode)
get { return ConvertConcreteSlotValueTypeToString(FindOutputSlot<MaterialSlot>(OutputSlotId).concreteValueType); }
}
private string input1Dimension
if (exposedState == ExposedState.Exposed || generationMode.IsPreview ())
return;
var input1Value = GetSlotValue (InputSlot1Id, generationMode);
var input2Value = GetSlotValue (InputSlot2Id, generationMode);
visitor.AddShaderChunk (precision + "4 " + propertyName + " = " + input1Value + " * ((" + input2Value + ".w - " + input2Value + ".z) + " + input2Value + ".z);", false);
get { return ConvertConcreteSlotValueTypeToString(FindInputSlot<MaterialSlot>(InputSlot1Id).concreteValueType); }
public override bool hasPreview {
get { return true; }
private string input2Dimension
{
get { return ConvertConcreteSlotValueTypeToString(FindInputSlot<MaterialSlot>(InputSlot2Id).concreteValueType); }
public override PreviewProperty GetPreviewProperty ()
public string input3Dimension
return new PreviewProperty {
m_Name = propertyName,
m_PropType = PropertyType.Vector4,
m_Vector4 = m_Value
};
}*/
get { return ConvertConcreteSlotValueTypeToString(FindInputSlot<MaterialSlot>(InputSlot3Id).concreteValueType); }
}
}
}

8
MaterialGraphProject/Assets/Rinaldo/BlendModeNode.cs


outputString.Deindent();
outputString.AddShaderChunk("}", false);
break;
case BlendModesEnum.Substract:
outputString.AddShaderChunk(GetFunctionPrototype("arg1", "arg2"), false);
outputString.AddShaderChunk("{", false);
outputString.Indent();
outputString.AddShaderChunk("return arg1 - arg2;", false);
outputString.Deindent();
outputString.AddShaderChunk("}", false);
break;
}
visitor.AddShaderChunk(outputString.GetShaderString(0), true);

2
MaterialGraphProject/Assets/Rinaldo/BlendModesEnum.cs


// PinLight,
Screen,
SoftLight,
// Substract,
Substract,
// VividLight

2
MaterialGraphProject/Assets/TestAssets/Sky1.jpg.meta


isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
cubemapConvolution: 1
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048

3
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/NodePreviewPresenter.cs


case PropertyType.Texture2D:
mat.SetTexture(previewProperty.m_Name, previewProperty.m_Texture);
break;
case PropertyType.Cubemap:
mat.SetTexture(previewProperty.m_Name, previewProperty.m_Cubemap);
break;
case PropertyType.Color:
mat.SetColor(previewProperty.m_Name, previewProperty.m_Color);
break;

97
MaterialGraphProject/Assets/UnityShaderEditor/Editor/HelperShader.shader


Shader "Unlit/NewUnlitShader"
Shader "Graph/UnityEngine.MaterialGraph.MetallicMasterNode6ab95a24-fc7d-4a4e-8828-a2de989d8143"
Properties
Properties
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
}
SubShader
{
Tags
{
"RenderType"="Opaque"
"Queue"="Geometry"
}
Blend One Zero
Cull Back
ZTest LEqual
ZWrite On
LOD 200
CGPROGRAM
#pragma target 3.0
#pragma surface surf Standard vertex:vert
#pragma glsl
#pragma debug
struct Input
Tags { "RenderType"="Opaque" }
LOD 100
float4 color : COLOR;
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
// make fog work
#pragma multi_compile_fog
#include "UnityCG.cginc"
};
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
void vert (inout appdata_full v, out Input o)
{
UNITY_INITIALIZE_OUTPUT(Input,o);
struct v2f
{
float2 uv : TEXCOORD0;
UNITY_FOG_COORDS(1)
float4 vertex : SV_POSITION;
};
}
void surf (Input IN, inout SurfaceOutputStandard o)
{
sampler2D _MainTex;
float4 _MainTex_ST;
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
UNITY_TRANSFER_FOG(o,o.vertex);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
// sample the texture
fixed4 col = tex2D(_MainTex, i.uv);
// apply fog
UNITY_APPLY_FOG(i.fogCoord, col);
return col;
}
ENDCG
}
ENDCG
}
FallBack "Diffuse"
}

6
MaterialGraphProject/Assets/UnityShaderEditor/Editor/HelperShader.shader.meta


fileFormatVersion: 2
guid: 9ab5e16c2083a4fe689209a8c1ae425e
timeCreated: 1495436993
timeCreated: 1495526268
nonModifiableTextures:
- Texture_2ad4e61d_d44e_4e70_b3d0_540eae630bdf_Uniform: {fileID: 2800000, guid: 76c3d794167d8524481195736f067518,
type: 3}
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

2
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Templates/2DPreview.template


v2f vert (appdata_full v)
{
v2f o = (v2f)0;
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
o.pos = UnityObjectToClipPos(v.vertex);;
${VertexShaderBody}
return o;
}

2
MaterialGraphProject/Assets/Vlad/UVRotatorNode.cs


namespace UnityEngine.MaterialGraph
{
[Title("Math/UVOperations/Rotator")]
[Title("UV/Rotator")]
public class UVRotatorNode : Function2Input, IGeneratesFunction
{
private const string kUVSlotName = "UV";

52
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Texture/CubemapNode.cs


namespace UnityEngine.MaterialGraph
{
[Title("Input/Cubemap")]
public class CubemapNode : PropertyNode, IGeneratesBodyCode, IMayRequireMeshUV
[Title("Input/Texture/Cubemap")]
public class CubemapNode : PropertyNode, IGeneratesBodyCode, IMayRequireViewDirection, IMayRequireNormal
protected const string kUVSlotName = "Refl";
protected const string kUVSlotName = "RefVector";
protected const string kInputSlotLodName = "MipLevel";
public const int InputSlotLod = 6;
public const int OutputSlotRgbaId = 1;
public const int OutputSlotRId = 2;
public const int OutputSlotGId = 3;

AddSlot(new MaterialSlot(OutputSlotBId, kOutputSlotBName, kOutputSlotBName, SlotType.Output, SlotValueType.Vector1, Vector4.zero));
AddSlot(new MaterialSlot(OutputSlotAId, kOutputSlotAName, kOutputSlotAName, SlotType.Output, SlotValueType.Vector1, Vector4.zero));
AddSlot(new MaterialSlot(UvSlotId, kUVSlotName, kUVSlotName, SlotType.Input, SlotValueType.Vector3, Vector3.zero, false));
AddSlot (new MaterialSlot(InputSlotLod, kInputSlotLodName, kInputSlotLodName, SlotType.Input, SlotValueType.Vector1, Vector2.zero));
RemoveSlotsNameNotMatching(validSlots);
}

protected int[] validSlots
{
get { return new[] {OutputSlotRgbaId, OutputSlotRId, OutputSlotGId, OutputSlotBId, OutputSlotAId, UvSlotId}; }
get { return new[] {OutputSlotRgbaId, OutputSlotRId, OutputSlotGId, OutputSlotBId, OutputSlotAId, UvSlotId, InputSlotLod}; }
}
// Node generations

if (uvSlot == null)
return;
var uvName = string.Format("{0}.xyz", UVChannel.uv0.GetUVName());
var edges = owner.GetEdges(uvSlot.slotReference).ToList();
var lodID = FindInputSlot<MaterialSlot>(InputSlotLod);
if (lodID == null)
return;
if (edges.Count > 0)
var uvName = "reflect(-worldSpaceViewDirection, worldSpaceNormal).xyz";
var lodValue = lodID.currentValue.x.ToString ();
var edgesUV = owner.GetEdges(uvSlot.slotReference).ToList();
var edgesLOD = owner.GetEdges (lodID.slotReference).ToList ();
if (edgesUV.Count > 0)
var edge = edges[0];
var edge = edgesUV[0];
string body = "texCUBE (" + propertyName + ", " + uvName + ")";
if (edgesLOD.Count > 0)
{
var edge = edgesLOD[0];
var fromNode = owner.GetNodeFromGuid<AbstractMaterialNode>(edge.outputSlot.nodeGuid);
lodValue = GetSlotValue (edge.inputSlot.slotId, GenerationMode.ForReals);
}
//reflect(-IN.worldViewDir, normalize(IN.worldNormal)).xyz
string body = "texCUBElod (" + propertyName + ", " + precision + "4(" + uvName + "," + lodValue + "))";
visitor.AddShaderChunk(precision + "4 " + GetVariableNameForNode() + " = " + body + ";", true);
}

public override PropertyType propertyType { get { return PropertyType.Cubemap; } }
public bool RequiresMeshUV(UVChannel channel)
public bool RequiresViewDirection()
if (channel != UVChannel.uv0)
{
return false;
}
return true;
}
var uvSlot = FindInputSlot<MaterialSlot>(UvSlotId);
if (uvSlot == null)
return true;
var edges = owner.GetEdges(uvSlot.slotReference).ToList();
return edges.Count == 0;
public bool RequiresNormal()
{
return true;
}
}
}

2
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/SceneData/DepthTextureNode.cs


namespace UnityEngine.MaterialGraph
{
[Title("Input/Depth Texture")]
[Title("Input/Scene Data/Depth Texture")]
public class DepthTextureNode : PropertyNode, IGeneratesBodyCode, IMayRequireMeshUV
{
protected const string kUVSlotName = "UV";

2
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/SceneData/MotionVectorTextureNode.cs


namespace UnityEngine.MaterialGraph
{
[Title("Input/Motion Vector Texture")]
[Title("Input/Scene Data/Motion Vector Texture")]
public class MotionVectorTextureNode : PropertyNode, IGeneratesBodyCode, IMayRequireMeshUV
{
protected const string kUVSlotName = "UV";

4
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector4Node.cs


namespace UnityEngine.MaterialGraph
{
[Title("Input/Vector 4 Node")]
[Title("Input/Vector/Vector 4")]
public class Vector4Node : PropertyNode, IGeneratesBodyCode
{
[SerializeField]

public Vector4Node()
{
name = "V4Node";
name = "Vector4";
UpdateNodeAfterDeserialization();
}

4
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Time/SinTimeNode.cs


namespace UnityEngine.MaterialGraph
{
[Title("Input/Sine Time Node")]
[Title("Input/Time/Sine Time")]
name = "Sine Time";
name = "SineTime";
UpdateNodeAfterDeserialization();
}

2
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Time/TimeNode.cs


namespace UnityEngine.MaterialGraph
{
[Title("Input/Time Node")]
[Title("Input/Time/Time")]
public class TimeNode : AbstractMaterialNode, IRequiresTime
{
private const string kOutputSlotName = "Time";

4
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector1Node.cs


namespace UnityEngine.MaterialGraph
{
[Title("Input/Vector 1 Node")]
[Title("Input/Vector/Vector 1")]
public class Vector1Node : PropertyNode, IGeneratesBodyCode
{
[SerializeField]

public Vector1Node()
{
name = "V1Node";
name = "Vector1";
UpdateNodeAfterDeserialization();
}

4
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector2Node.cs


namespace UnityEngine.MaterialGraph
{
[Title("Input/Vector 2 Node")]
[Title("Input/Vector/Vector 2")]
public class Vector2Node : PropertyNode, IGeneratesBodyCode
{
private const int kOutputSlotId = 0;

public Vector2Node()
{
name = "V2Node";
name = "Vector2";
UpdateNodeAfterDeserialization();
}

4
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector3Node.cs


namespace UnityEngine.MaterialGraph
{
[Title("Input/Vector 3 Node")]
[Title("Input/Vector/Vector 3")]
public class Vector3Node : PropertyNode, IGeneratesBodyCode
{
private const int kOutputSlotId = 0;

public Vector3Node()
{
name = "V3Node";
name = "Vector3";
UpdateNodeAfterDeserialization();
}

4
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/ColorNode.cs


namespace UnityEngine.MaterialGraph
{
[Title("Input/Color Node")]
[Title("Input/Color")]
public class ColorNode : PropertyNode, IGeneratesBodyCode
{
[SerializeField]

public ColorNode()
{
name = "ColorNode";
name = "Color";
UpdateNodeAfterDeserialization();
}

4
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/SceneData/ScreenPosNode.cs


bool RequiresScreenPosition();
}
[Title("Input/Screen Pos Node")]
[Title("Input/Scene Data/Screen Position")]
name = "ScreenPos";
name = "ScreenPosition";
UpdateNodeAfterDeserialization();
}

4
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpacePositionNode.cs


bool RequiresWorldPosition();
}
[Title("Input/World Space Position Node")]
[Title("Input/Geometry/World Space Position")]
public class WorldSpacePositionNode : AbstractMaterialNode, IMayRequireWorldPosition
{
private const int kOutputSlotId = 0;

public WorldSpacePositionNode()
{
name = "World Space Pos";
name = "WorldSpacePosition";
UpdateNodeAfterDeserialization();
}

4
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpaceViewDirectionNode.cs


bool RequiresViewDirection();
}
[Title("Input/World Space View Direction Node")]
[Title("Input/Geometry/World Space View Direction")]
public class WorldSpaceViewDirectionNode : AbstractMaterialNode, IMayRequireViewDirection
{
private const int kOutputSlotId = 0;

public WorldSpaceViewDirectionNode()
{
name = "World View Direction";
name = "WorldSpaceViewDirection";
UpdateNodeAfterDeserialization();
}

4
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpaceNormalNode.cs


bool RequiresNormal();
}
[Title("Input/World Normal Node")]
[Title("Input/Geometry/World Normal")]
public class WorldSpaceNormalNode : AbstractMaterialNode, IMayRequireNormal
{
public const int kOutputSlotId = 0;

{
name = "World Normal";
name = "WorldNormal";
UpdateNodeAfterDeserialization();
}

4
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpaceTangentNode.cs


bool RequiresTangent();
}
[Title("Input/World Tangent Node")]
[Title("Input/Geometry/World Tangent")]
public class WorldSpaceTangentNode : AbstractMaterialNode, IMayRequireTangent
{
public const int kOutputSlotId = 0;

{
name = "World Tangent";
name = "WorldTangent";
UpdateNodeAfterDeserialization();
}

4
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpaceBitangentNode.cs


bool RequiresBitangent();
}
[Title("Input/World Bitangent Node")]
[Title("Input/Geometry/World Bitangent")]
public class WorldSpaceBitangentNode : AbstractMaterialNode, IMayRequireBitangent
{
public const int kOutputSlotId = 0;

{
name = "World Bitangent";
name = "WorldBitangent";
UpdateNodeAfterDeserialization();
}

4
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/VertexColorNode.cs


bool RequiresVertexColor();
}
[Title("Input/Vertex Color Node")]
[Title("Input/Geometry/Vertex Color")]
public class VertexColorNode : AbstractMaterialNode, IMayRequireVertexColor
{
private const int kOutputSlotId = 0;

public VertexColorNode()
{
name = "Vertex Color";
name = "VertexColor";
UpdateNodeAfterDeserialization();
}

2
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/UVNode.cs


bool RequiresMeshUV(UVChannel channel);
}
[Title("Input/UV Node")]
[Title("Input/Geometry/UV")]
public class UVNode : AbstractMaterialNode, IGeneratesBodyCode, IMayRequireMeshUV
{
public const int OutputSlotId = 0;

2
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Texture/TextureNode.cs


namespace UnityEngine.MaterialGraph
{
[Title("Input/Texture Node")]
[Title("Input/Texture/Texture")]
public class TextureNode : PropertyNode, IGeneratesBodyCode, IMayRequireMeshUV
{
protected const string kUVSlotName = "UV";

2
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Texture/TextureLODNode.cs


namespace UnityEngine.MaterialGraph
{
[Title("Input/TextureLOD")]
[Title("Input/Texture/TextureLOD")]
public class TextureLODNode : PropertyNode, IGeneratesBodyCode, IMayRequireMeshUV
{
protected const string kUVSlotName = "UV";

9
MaterialGraphProject/Assets/Andre.meta


fileFormatVersion: 2
guid: cd5688ca09d4248698f2b43253441000
folderAsset: yes
timeCreated: 1495479128
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

71
MaterialGraphProject/Assets/Brandon/LineNode.cs


namespace UnityEngine.MaterialGraph
{
[Title("Procedural/Line Node")]
public class LineNode : Function3Input, IGeneratesFunction
{
public LineNode()
{
name = "LineNode";
}
protected override string GetFunctionName()
{
return "unity_linenode_" + precision;
}
protected override string GetInputSlot1Name()
{
return "UV";
}
protected override string GetInputSlot2Name()
{
return "StartPoint";
}
protected override string GetInputSlot3Name()
{
return "EndPoint";
}
protected override MaterialSlot GetInputSlot1()
{
return new MaterialSlot(InputSlot1Id, GetInputSlot1Name(), kInputSlot1ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Vector2, Vector2.zero);
}
protected override MaterialSlot GetInputSlot2()
{
return new MaterialSlot(InputSlot2Id, GetInputSlot2Name(), kInputSlot2ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Vector2, Vector2.zero);
}
protected override MaterialSlot GetInputSlot3()
{
return new MaterialSlot(InputSlot3Id, GetInputSlot3Name(), kInputSlot3ShaderName, UnityEngine.Graphing.SlotType.Input, SlotValueType.Vector2, Vector2.zero);
}
protected override MaterialSlot GetOutputSlot()
{
return new MaterialSlot(OutputSlotId, GetOutputSlotName(), kOutputSlotShaderName, UnityEngine.Graphing.SlotType.Output, SlotValueType.Vector1, Vector2.zero);
}
public void GenerateNodeFunction(ShaderGenerator visitor, GenerationMode generationMode)
{
var outputString = new ShaderGenerator();
outputString.AddShaderChunk(GetFunctionPrototype("uv", "a", "b"), false);
outputString.AddShaderChunk("{", false);
outputString.Indent();
outputString.AddShaderChunk("float2 aTob = b - a;", false);
outputString.AddShaderChunk("float2 aTop = uv - a;", false);
outputString.AddShaderChunk("float t = dot(aTop, aTob) / dot(aTob, aTob);", false);
outputString.AddShaderChunk("t = clamp(t, 0.0, 1.0);", false);
outputString.AddShaderChunk("float d = 1.0 / length(uv - (a + aTob * t));", false);
outputString.AddShaderChunk("return clamp(d, 0.0, 1.0);", false);
outputString.Deindent();
outputString.AddShaderChunk("}", false);
visitor.AddShaderChunk(outputString.GetShaderString(0), true);
}
}
}

12
MaterialGraphProject/Assets/Brandon/LineNode.cs.meta


fileFormatVersion: 2
guid: 10fe1b4258a2ed646925d0ec6bdc35f2
timeCreated: 1495489255
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

43
MaterialGraphProject/Assets/Matt/LinearToRGB.cs


using UnityEngine.Graphing;
namespace UnityEngine.MaterialGraph
{
[Title ("Math/Color/LineartoRGB")]
public class LineartoRGBNode : Function1Input, IGeneratesFunction
{
public LineartoRGBNode()
{
name = "RGBtoLinear";
}
protected override string GetFunctionName ()
{
return "unity_lineartorgb_" + precision;
}
protected override MaterialSlot GetInputSlot ()
{
return new MaterialSlot (InputSlotId, GetInputSlotName (), kInputSlotShaderName, SlotType.Input, SlotValueType.Vector3, Vector4.zero);
}
protected override MaterialSlot GetOutputSlot ()
{
return new MaterialSlot (OutputSlotId, GetOutputSlotName (), kOutputSlotShaderName, SlotType.Output, SlotValueType.Vector3, Vector4.zero);
}
public void GenerateNodeFunction (ShaderGenerator visitor, GenerationMode generationMode)
{
var outputString = new ShaderGenerator ();
outputString.AddShaderChunk (GetFunctionPrototype ("arg1"), false);
outputString.AddShaderChunk ("{", false);
outputString.Indent ();
outputString.AddShaderChunk (precision + "3 sRGBLo = arg1 * 12.92;", false);
outputString.AddShaderChunk (precision + "3 sRGBHi = (pow(max(abs(arg1), 1.192092896e-07), "+precision+ "3(1.0 / 2.4, 1.0 / 2.4, 1.0 / 2.4)) * 1.055) - 0.055;", false);
outputString.AddShaderChunk ("return " + precision + "3(arg1 <= 0.0031308) ? sRGBLo : sRGBHi;", false);
outputString.Deindent ();
outputString.AddShaderChunk ("}", false);
visitor.AddShaderChunk (outputString.GetShaderString (0), true);
}
}
}

12
MaterialGraphProject/Assets/Matt/LinearToRGB.cs.meta


fileFormatVersion: 2
guid: 667e5671fc459344c889207ff866ab08
timeCreated: 1444218016
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

43
MaterialGraphProject/Assets/Matt/RGBtoLinear.cs


using UnityEngine.Graphing;
namespace UnityEngine.MaterialGraph
{
[Title ("Math/Color/RGBtoLinear")]
public class RGBtoLinearNode : Function1Input, IGeneratesFunction
{
public RGBtoLinearNode()
{
name = "RGBtoLinear";
}
protected override string GetFunctionName ()
{
return "unity_rgbtolinear_" + precision;
}
protected override MaterialSlot GetInputSlot ()
{
return new MaterialSlot (InputSlotId, GetInputSlotName (), kInputSlotShaderName, SlotType.Input, SlotValueType.Vector3, Vector4.zero);
}
protected override MaterialSlot GetOutputSlot ()
{
return new MaterialSlot (OutputSlotId, GetOutputSlotName (), kOutputSlotShaderName, SlotType.Output, SlotValueType.Vector3, Vector4.zero);
}
public void GenerateNodeFunction (ShaderGenerator visitor, GenerationMode generationMode)
{
var outputString = new ShaderGenerator ();
outputString.AddShaderChunk (GetFunctionPrototype ("arg1"), false);
outputString.AddShaderChunk ("{", false);
outputString.Indent ();
outputString.AddShaderChunk (precision + "3 linearRGBLo = arg1 / 12.92;", false);
outputString.AddShaderChunk (precision + "3 linearRGBHi = pow(max(abs((arg1 + 0.055) / 1.055), 1.192092896e-07), "+precision+"3(2.4, 2.4, 2.4));", false);
outputString.AddShaderChunk ("return " + precision + "3(arg1 <= 0.04045) ? linearRGBLo : linearRGBHi;", false);
outputString.Deindent ();
outputString.AddShaderChunk ("}", false);
visitor.AddShaderChunk (outputString.GetShaderString (0), true);
}
}
}

12
MaterialGraphProject/Assets/Matt/RGBtoLinear.cs.meta


fileFormatVersion: 2
guid: e282583a8fbbf2742bd10d617611c8b0
timeCreated: 1444218016
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

1
MaterialGraphProject/Assets/TestGraph.ShaderGraph


{"m_SerializableNodes":[],"m_SerializableEdges":[],"m_ActiveMasterNodeGUIDSerialized":"0639ef3c-6358-4a2a-aecd-84dca08c377f"}

9
MaterialGraphProject/Assets/TestGraph.ShaderGraph.meta


fileFormatVersion: 2
guid: 037778188549d9b4e8102cd29dea21a9
timeCreated: 1495526245
licenseType: Pro
ScriptedImporter:
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

110
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/UnitTests/Function4InputTests.cs


using System;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.Graphing;
using UnityEngine.MaterialGraph;
namespace UnityEditor.MaterialGraph.UnitTests
{
[TestFixture]
public class Function4InputTests
{
private class Function4InputTestNode : Function4Input, IGeneratesFunction
{
public Function4InputTestNode()
{
name = "Function4InputTestNode";
}
protected override string GetFunctionName()
{
return "unity_test_" + precision;
}
public void GenerateNodeFunction(ShaderGenerator visitor, GenerationMode generationMode)
{
var outputString = new ShaderGenerator();
outputString.AddShaderChunk(GetFunctionPrototype("arg1", "arg2", "arg3", "arg4"), false);
outputString.AddShaderChunk("{", false);
outputString.Indent();
outputString.AddShaderChunk("return arg1 + arg2 + arg3 + arg4;", false);
outputString.Deindent();
outputString.AddShaderChunk("}", false);
visitor.AddShaderChunk(outputString.GetShaderString(0), true);
}
}
private UnityEngine.MaterialGraph.MaterialGraph m_Graph;
private Vector1Node m_InputOne;
private Vector1Node m_InputTwo;
private Vector1Node m_InputThree;
private Vector1Node m_InputFour;
private Function4InputTestNode m_TestNode;
[TestFixtureSetUp]
public void RunBeforeAnyTests()
{
Debug.unityLogger.logHandler = new ConsoleLogHandler();
}
[SetUp]
public void TestSetUp()
{
m_Graph = new UnityEngine.MaterialGraph.MaterialGraph();
m_InputOne = new Vector1Node();
m_InputTwo = new Vector1Node();
m_InputThree = new Vector1Node();
m_InputFour = new Vector1Node();
m_TestNode = new Function4InputTestNode();
m_Graph.AddNode(m_InputOne);
m_Graph.AddNode(m_InputTwo);
m_Graph.AddNode(m_InputThree);
m_Graph.AddNode(m_InputFour);
m_Graph.AddNode(m_TestNode);
m_Graph.AddNode(new MetallicMasterNode());
m_InputOne.value = 0.2f;
m_InputTwo.value = 0.3f;
m_InputThree.value = 0.6f;
m_InputFour.value = 0.6f;
m_Graph.Connect(m_InputOne.GetSlotReference(Vector1Node.OutputSlotId), m_TestNode.GetSlotReference(Function4Input.InputSlot1Id));
m_Graph.Connect(m_InputTwo.GetSlotReference(Vector1Node.OutputSlotId), m_TestNode.GetSlotReference(Function4Input.InputSlot2Id));
m_Graph.Connect(m_InputThree.GetSlotReference(Vector1Node.OutputSlotId), m_TestNode.GetSlotReference(Function4Input.InputSlot3Id));
m_Graph.Connect(m_InputThree.GetSlotReference(Vector1Node.OutputSlotId), m_TestNode.GetSlotReference(Function4Input.InputSlot4Id));
m_Graph.Connect(m_TestNode.GetSlotReference(Function4Input.OutputSlotId), m_Graph.masterNode.GetSlotReference(MetallicMasterNode.NormalSlotId));
}
[Test]
public void TestGenerateNodeCodeGeneratesCorrectCode()
{
string expected = string.Format("half {0} = unity_test_half ({1}, {2}, {3}, {4});{5}"
, m_TestNode.GetVariableNameForSlot(Function3Input.OutputSlotId)
, m_InputOne.GetVariableNameForSlot(Vector1Node.OutputSlotId)
, m_InputTwo.GetVariableNameForSlot(Vector1Node.OutputSlotId)
, m_InputThree.GetVariableNameForSlot(Vector1Node.OutputSlotId)
, m_InputFour.GetVariableNameForSlot(Vector1Node.OutputSlotId)
, Environment.NewLine);
ShaderGenerator visitor = new ShaderGenerator();
m_TestNode.GenerateNodeCode(visitor, GenerationMode.ForReals);
Assert.AreEqual(expected, visitor.GetShaderString(0));
}
[Test]
public void TestGenerateNodeFunctionGeneratesCorrectCode()
{
string expected =
"inline half unity_test_half (half arg1, half arg2, half arg3, half arg4)" + Environment.NewLine
+ "{" + Environment.NewLine
+ "\treturn arg1 + arg2 + arg3 + arg4;" + Environment.NewLine
+ "}" + Environment.NewLine;
ShaderGenerator visitor = new ShaderGenerator();
m_TestNode.GenerateNodeFunction(visitor, GenerationMode.ForReals);
Assert.AreEqual(expected, visitor.GetShaderString(0));
}
}
}

12
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Testing/UnitTests/Function4InputTests.cs.meta


fileFormatVersion: 2
guid: 6fc8f3d4460595e44bb2fb21831294a8
timeCreated: 1495484604
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

145
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Function4Input.cs


using UnityEngine.Graphing;
namespace UnityEngine.MaterialGraph
{
public abstract class Function4Input : AbstractMaterialNode, IGeneratesBodyCode
{
protected const string kInputSlot1ShaderName = "Input1";
protected const string kInputSlot2ShaderName = "Input2";
protected const string kInputSlot3ShaderName = "Input3";
protected const string kInputSlot4ShaderName = "Input4";
protected const string kOutputSlotShaderName = "Output";
public const int InputSlot1Id = 0;
public const int InputSlot2Id = 1;
public const int InputSlot3Id = 2;
public const int InputSlot4Id = 3;
public const int OutputSlotId = 4;
public override bool hasPreview
{
get { return true; }
}
protected Function4Input()
{
UpdateNodeAfterDeserialization();
}
public sealed override void UpdateNodeAfterDeserialization()
{
AddSlot(GetInputSlot1());
AddSlot(GetInputSlot2());
AddSlot(GetInputSlot3());
AddSlot(GetInputSlot4());
AddSlot(GetOutputSlot());
RemoveSlotsNameNotMatching(validSlots);
}
protected int[] validSlots
{
get { return new[] { InputSlot1Id, InputSlot2Id, InputSlot3Id, InputSlot4Id, OutputSlotId }; }
}
protected virtual MaterialSlot GetInputSlot1()
{
return new MaterialSlot(InputSlot1Id, GetInputSlot1Name(), kInputSlot1ShaderName, SlotType.Input, SlotValueType.Dynamic, Vector4.zero);
}
protected virtual MaterialSlot GetInputSlot2()
{
return new MaterialSlot(InputSlot2Id, GetInputSlot2Name(), kInputSlot2ShaderName, SlotType.Input, SlotValueType.Dynamic, Vector4.zero);
}
protected virtual MaterialSlot GetInputSlot3()
{
return new MaterialSlot(InputSlot3Id, GetInputSlot3Name(), kInputSlot3ShaderName, SlotType.Input, SlotValueType.Dynamic, Vector4.zero);
}
protected virtual MaterialSlot GetInputSlot4()
{
return new MaterialSlot(InputSlot4Id, GetInputSlot4Name(), kInputSlot4ShaderName, SlotType.Input, SlotValueType.Dynamic, Vector4.zero);
}
protected virtual MaterialSlot GetOutputSlot()
{
return new MaterialSlot(OutputSlotId, GetOutputSlotName(), kOutputSlotShaderName, SlotType.Output, SlotValueType.Dynamic, Vector4.zero);
}
protected virtual string GetInputSlot1Name()
{
return "Input1";
}
protected virtual string GetInputSlot2Name()
{
return "Input2";
}
protected virtual string GetInputSlot3Name()
{
return "Input3";
}
protected virtual string GetInputSlot4Name()
{
return "Input4";
}
protected virtual string GetOutputSlotName()
{
return "Output";
}
protected abstract string GetFunctionName();
protected virtual string GetFunctionPrototype(string arg1Name, string arg2Name, string arg3Name, string arg4Name)
{
return "inline " + precision + outputDimension + " " + GetFunctionName() + " ("
+ precision + input1Dimension + " " + arg1Name + ", "
+ precision + input2Dimension + " " + arg2Name + ", "
+ precision + input3Dimension + " " + arg3Name + ", "
+ precision + input4Dimension + " " + arg4Name + ")";
}
public void GenerateNodeCode(ShaderGenerator visitor, GenerationMode generationMode)
{
NodeUtils.SlotConfigurationExceptionIfBadConfiguration(this, new[] { InputSlot1Id, InputSlot2Id, InputSlot3Id }, new[] { OutputSlotId });
string input1Value = GetSlotValue(InputSlot1Id, generationMode);
string input2Value = GetSlotValue(InputSlot2Id, generationMode);
string input3Value = GetSlotValue(InputSlot3Id, generationMode);
string input4Value = GetSlotValue(InputSlot4Id, generationMode);
visitor.AddShaderChunk(precision + outputDimension + " " + GetVariableNameForSlot(OutputSlotId) + " = " + GetFunctionCallBody(input1Value, input2Value, input3Value, input4Value) + ";", true);
}
protected virtual string GetFunctionCallBody(string inputValue1, string inputValue2, string inputValue3, string inputValue4)
{
return GetFunctionName() + " (" + inputValue1 + ", " + inputValue2 + ", " + inputValue3 + ", " + inputValue4 + ")";
}
public string outputDimension
{
get { return ConvertConcreteSlotValueTypeToString(FindOutputSlot<MaterialSlot>(OutputSlotId).concreteValueType); }
}
private string input1Dimension
{
get { return ConvertConcreteSlotValueTypeToString(FindInputSlot<MaterialSlot>(InputSlot1Id).concreteValueType); }
}
private string input2Dimension
{
get { return ConvertConcreteSlotValueTypeToString(FindInputSlot<MaterialSlot>(InputSlot2Id).concreteValueType); }
}
public string input3Dimension
{
get { return ConvertConcreteSlotValueTypeToString(FindInputSlot<MaterialSlot>(InputSlot3Id).concreteValueType); }
}
public string input4Dimension
{
get { return ConvertConcreteSlotValueTypeToString(FindInputSlot<MaterialSlot>(InputSlot4Id).concreteValueType); }
}
}
}

12
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Function4Input.cs.meta


fileFormatVersion: 2
guid: a4d44a805d21cc34d81319e66c9c70a4
timeCreated: 1495481765
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

9
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input.meta


fileFormatVersion: 2
guid: 0ab9e53346965db4a8ee81a2b978dca5
folderAsset: yes
timeCreated: 1495526789
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
MaterialGraphProject/Assets/Andre/New Shader Graph.ShaderGraph.meta


fileFormatVersion: 2
guid: 8c255d11f15384beb834142327f24126
timeCreated: 1495482510
licenseType: Pro
ScriptedImporter:
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}

363
MaterialGraphProject/Assets/Andre/Andre_scene.unity


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 8
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.18030335, g: 0.22573312, b: 0.3069612, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_TemporalCoherenceThreshold: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 1
m_LightmapEditorSettings:
serializedVersion: 9
m_Resolution: 2
m_BakeResolution: 40
m_TextureWidth: 1024
m_TextureHeight: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 0
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVRFiltering: 0
m_PVRFilteringMode: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousColorSigma: 1
m_PVRFilteringAtrousNormalSigma: 1
m_PVRFilteringAtrousPositionSigma: 1
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &294444510
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 294444515}
- component: {fileID: 294444514}
- component: {fileID: 294444513}
- component: {fileID: 294444512}
- component: {fileID: 294444511}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &294444511
AudioListener:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 294444510}
m_Enabled: 1
--- !u!124 &294444512
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 294444510}
m_Enabled: 1
--- !u!92 &294444513
Behaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 294444510}
m_Enabled: 1
--- !u!20 &294444514
Camera:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 294444510}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0
--- !u!4 &294444515
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 294444510}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &652427887
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 652427891}
- component: {fileID: 652427890}
- component: {fileID: 652427889}
- component: {fileID: 652427888}
m_Layer: 0
m_Name: Sphere
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!23 &652427888
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 652427887}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: dda1f1cabce3b47b29c93c49b3be587c, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
--- !u!135 &652427889
SphereCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 652427887}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!33 &652427890
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 652427887}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &652427891
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 652427887}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.14875561, y: 0.018139817, z: 0.08210238}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1553459920
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1553459922}
- component: {fileID: 1553459921}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &1553459921
Light:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1553459920}
m_Enabled: 1
serializedVersion: 8
m_Type: 1
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 4
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_FalloffTable:
m_Table[0]: 0
m_Table[1]: 0
m_Table[2]: 0
m_Table[3]: 0
m_Table[4]: 0
m_Table[5]: 0
m_Table[6]: 0
m_Table[7]: 0
m_Table[8]: 0
m_Table[9]: 0
m_Table[10]: 0
m_Table[11]: 0
m_Table[12]: 0
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &1553459922
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1553459920}
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}

8
MaterialGraphProject/Assets/Andre/Andre_scene.unity.meta


fileFormatVersion: 2
guid: 2040c799ac19a427d84a1876f612f926
timeCreated: 1495487504
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

87
MaterialGraphProject/Assets/Andre/New Material.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: New Material
m_Shader: {fileID: 4800000, guid: 9ab5e16c2083a4fe689209a8c1ae425e, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- Cubemap_dc3182b8_fe99_45ed_8c1d_67fb354034bd_Uniform:
m_Texture: {fileID: 8900000, guid: f7111c407ddfe4109af9703cb740eaf9, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- Cubemap_ee09e335_3be2_46ee_9d59_ce2673aeedf9_Uniform:
m_Texture: {fileID: 8900000, guid: f7111c407ddfe4109af9703cb740eaf9, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- Texture_5537060b_db74_4900_8f2b_178ba97b7f11_Uniform:
m_Texture: {fileID: 2800000, guid: 6e8d12f68bae2294da814f9d4c81b29a, type: 3}
m_Scale: {x: 1, y: 2}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}

9
MaterialGraphProject/Assets/Andre/New Material.mat.meta


fileFormatVersion: 2
guid: dda1f1cabce3b47b29c93c49b3be587c
timeCreated: 1495485047
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

1
MaterialGraphProject/Assets/Andre/New Shader Graph.ShaderGraph
文件差异内容过多而无法显示
查看文件

9
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry.meta


fileFormatVersion: 2
guid: 5e9138df313dc9e4fa20f92625c26b59
folderAsset: yes
timeCreated: 1495527166
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/SceneData.meta


fileFormatVersion: 2
guid: ad6f48f5ba4c9a24ab7b9df345b45d6f
folderAsset: yes
timeCreated: 1495527773
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Texture.meta


fileFormatVersion: 2
guid: 07cc6493671f2344089936cf4a0ab49b
folderAsset: yes
timeCreated: 1495528572
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

12
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Texture/CubemapNode.cs.meta


fileFormatVersion: 2
guid: c184bca342bb146daa708a7ecda424fc
timeCreated: 1495482070
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

9
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Time.meta


fileFormatVersion: 2
guid: 5d0ea40228d32a44c94e79db32eb2060
folderAsset: yes
timeCreated: 1495529303
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector.meta


fileFormatVersion: 2
guid: 1ccfba538a5b85b43a9d78f3057e00f2
folderAsset: yes
timeCreated: 1495526799
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

25
MaterialGraphProject/obj/Debug/Assembly-CSharp.csproj.FilesWrittenAbsolute.txt


/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/Assembly-CSharp.dll.mdb
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/Assembly-CSharp.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/obj/Debug/Assembly-CSharp.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/obj/Debug/Assembly-CSharp.dll.mdb
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/UnityEngine.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/UnityEditor.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/UnityEngine.UI.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/UnityEngine.Networking.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/UnityEngine.PerformanceTesting.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/UnityEngine.TestRunner.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/nunit.framework.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/UnityEngine.Timeline.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/UnityEngine.UIAutomation.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/UnityEngine.Analytics.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/UnityEngine.HoloLens.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/Mono.Cecil.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/Unity.SerializationLogic.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/Unity.DataContract.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/ExCSS.Unity.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/Unity.Legacy.NRefactory.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/Unity.UNetWeaver.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/Unity.UNetWeaver.dll.mdb
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/Unity.CecilTools.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/Mono.Cecil.Pdb.dll
/Users/andremcgrail/Documents/UnityProjects/External Projects/MaterialGraph/MaterialGraphProject/Temp/bin/Debug/Mono.Cecil.Mdb.dll

1001
MaterialGraphProject/obj/Debug/Assembly-CSharp.dll
文件差异内容过多而无法显示
查看文件

171
MaterialGraphProject/obj/Debug/Assembly-CSharp.dll.mdb
文件差异内容过多而无法显示
查看文件

8
MaterialGraphProject/Assets/Matt&Andre/CubemapNode.cs.meta


fileFormatVersion: 2
guid: c184bca342bb146daa708a7ecda424fc
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:

/MaterialGraphProject/Assets/Matt&Andre/CubemapNode.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Texture/CubemapNode.cs

/MaterialGraphProject/Assets/Matt/DepthTexture.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/SceneData/DepthTextureNode.cs

/MaterialGraphProject/Assets/Matt/MotionVectorTexture.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/SceneData/MotionVectorTextureNode.cs

/MaterialGraphProject/Assets/Matt/MotionVectorTexture.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/SceneData/MotionVectorTextureNode.cs.meta

/MaterialGraphProject/Assets/Matt/DepthTexture.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/SceneData/DepthTextureNode.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Vector4Node.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector4Node.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Vector4Node.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector4Node.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/ColorNode.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/ColorNode.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/ScreenPosNode.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/SceneData/ScreenPosNode.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/SinTimeNode.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Time/SinTimeNode.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/SinTimeNode.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Time/SinTimeNode.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/TextureNode.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Texture/TextureNode.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/TimeNode.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Time/TimeNode.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/TimeNode.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Time/TimeNode.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/UVNode.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/UVNode.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Vector1Node.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector1Node.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Vector1Node.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector1Node.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Vector2Node.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector2Node.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Vector2Node.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector2Node.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Vector3Node.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector3Node.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Vector3Node.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Vector/Vector3Node.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/ColorNode.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/ColorNode.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/ScreenPosNode.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/SceneData/ScreenPosNode.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/WorldSpacePositionNode.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpacePositionNode.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/WorldSpaceViewDirectionNode.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpaceViewDirectionNode.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/WorldSpaceNormalNode.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpaceNormalNode.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/WorldSpaceViewDirectionNode.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpaceViewDirectionNode.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/WorldSpacePositionNode.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpacePositionNode.cs.meta

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/WorldSpaceNormalNode.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpaceNormalNode.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/WorldSpaceTangentNode.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpaceTangentNode.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/WorldSpaceTangentNode.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/Input/Geometry/WorldSpaceTangentNode.cs.meta

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

正在加载...
取消
保存