浏览代码

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

/main
RinaldoTjan 8 年前
当前提交
67baa28e
共有 8 个文件被更改,包括 164 次插入0 次删除
  1. 29
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/MatrixMultiplyNode.cs
  2. 12
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/MatrixMultiplyNode.cs.meta
  3. 29
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/MatrixTransposeNode.cs
  4. 12
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/MatrixTransposeNode.cs.meta
  5. 29
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/VectorProjectionNode.cs
  6. 12
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/VectorProjectionNode.cs.meta
  7. 29
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/VectorRejectionNode.cs
  8. 12
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/VectorRejectionNode.cs.meta

29
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/MatrixMultiplyNode.cs


namespace UnityEngine.MaterialGraph
{
[Title("Matrix/Multiply Node")]
public class MatrixMultiplyNode : Function2Input, IGeneratesFunction
{
public MatrixMultiplyNode()
{
name = "MatrixMultiplyNode";
}
protected override string GetFunctionName()
{
return "unity_matrix_multiply_" + precision;
}
public void GenerateNodeFunction(ShaderGenerator visitor, GenerationMode generationMode)
{
var outputString = new ShaderGenerator();
outputString.AddShaderChunk(GetFunctionPrototype("arg1", "arg2"), false);
outputString.AddShaderChunk("{", false);
outputString.Indent();
outputString.AddShaderChunk("return mul(arg1, arg2);", false);
outputString.Deindent();
outputString.AddShaderChunk("}", false);
visitor.AddShaderChunk(outputString.GetShaderString(0), true);
}
}
}

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


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

29
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/MatrixTransposeNode.cs


namespace UnityEngine.MaterialGraph
{
[Title("Matrix/Transpose Node")]
public class MatrixTransposeNode : Function1Input, IGeneratesFunction
{
public MatrixTransposeNode()
{
name = "MatrixTranspose";
}
protected override string GetFunctionName()
{
return "unity_matrix_transpose_" + precision;
}
public void GenerateNodeFunction(ShaderGenerator visitor, GenerationMode generationMode)
{
var outputString = new ShaderGenerator();
outputString.AddShaderChunk(GetFunctionPrototype("arg1"), false);
outputString.AddShaderChunk("{", false);
outputString.Indent();
outputString.AddShaderChunk("return transpose(arg1);", false);
outputString.Deindent();
outputString.AddShaderChunk("}", false);
visitor.AddShaderChunk(outputString.GetShaderString(0), true);
}
}
}

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


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

29
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/VectorProjectionNode.cs


namespace UnityEngine.MaterialGraph
{
[Title("Vector/Projection Node")]
public class VectorProjectionNode : Function2Input, IGeneratesFunction
{
public VectorProjectionNode()
{
name = "VectorProjection";
}
protected override string GetFunctionName()
{
return "unity_vector_projection_" + precision;
}
public void GenerateNodeFunction(ShaderGenerator visitor, GenerationMode generationMode)
{
var outputString = new ShaderGenerator();
outputString.AddShaderChunk(GetFunctionPrototype("arg1", "arg2"), false);
outputString.AddShaderChunk("{", false);
outputString.Indent();
outputString.AddShaderChunk("return arg2 * dot(arg1, arg2) / dot(arg2, arg2);", false);
outputString.Deindent();
outputString.AddShaderChunk("}", false);
visitor.AddShaderChunk(outputString.GetShaderString(0), true);
}
}
}

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


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

29
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/VectorRejectionNode.cs


namespace UnityEngine.MaterialGraph
{
[Title("Vector/Rejection Node")]
public class VectorRejectionNode : Function2Input, IGeneratesFunction
{
public VectorRejectionNode()
{
name = "VectorRejection";
}
protected override string GetFunctionName()
{
return "unity_vector_rejection_" + precision;
}
public void GenerateNodeFunction(ShaderGenerator visitor, GenerationMode generationMode)
{
var outputString = new ShaderGenerator();
outputString.AddShaderChunk(GetFunctionPrototype("arg1", "arg2"), false);
outputString.AddShaderChunk("{", false);
outputString.Indent();
outputString.AddShaderChunk("return arg1 - (arg2 * dot(arg1, arg2) / dot(arg2, arg2));", false);
outputString.Deindent();
outputString.AddShaderChunk("}", false);
visitor.AddShaderChunk(outputString.GetShaderString(0), true);
}
}
}

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


fileFormatVersion: 2
guid: 831bc8761a9c9493aac513acc02d3577
timeCreated: 1495542985
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存