浏览代码

Add Matrix Determinant node

/main
Matt Dean 7 年前
当前提交
06549ef3
共有 2 个文件被更改,包括 43 次插入0 次删除
  1. 31
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Math/Matrix/MatrixDeterminantNode.cs
  2. 12
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Math/Matrix/MatrixDeterminantNode.cs.meta

31
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Math/Matrix/MatrixDeterminantNode.cs


using System.Reflection;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
[Title("Math", "Matrix", "Matrix Determinant")]
public class MatrixDeterminantNode : CodeFunctionNode
{
public MatrixDeterminantNode()
{
name = "Matrix Determinant";
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_MatrixDeterminant", BindingFlags.Static | BindingFlags.NonPublic);
}
static string Unity_MatrixDeterminant(
[Slot(0, Binding.None)] DynamicDimensionMatrix In,
[Slot(1, Binding.None)] out Vector1 Out)
{
return
@"
{
Out = determinant(In);
}
";
}
}
}

12
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Math/Matrix/MatrixDeterminantNode.cs.meta


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