浏览代码

Merge pull request #98 from Unity-Technologies/node-bugfixes

Maths nodes bugfixes
/main
GitHub 7 年前
当前提交
46e0e4e5
共有 7 个文件被更改,包括 28 次插入27 次删除
  1. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Interfaces/NeededCoordinateSpace.cs
  2. 12
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Math/Derivative/DDXNode.cs
  3. 12
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Math/Derivative/DDXYNode.cs
  4. 12
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Math/Derivative/DDYNode.cs
  5. 8
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Math/Vector/CrossProductNode.cs
  6. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Math/Vector/DistanceNode.cs
  7. 7
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Math/Vector/ReflectionNode.cs

2
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Interfaces/NeededCoordinateSpace.cs


public static string ToVariableName(this CoordinateSpace space, InterpolatorType type)
{
var index = (int)space * s_SpaceCount + (int)type;
var index = (int)space + (int)type * s_SpaceCount;
if (string.IsNullOrEmpty(s_VariableNames[index]))
s_VariableNames[index] = string.Format("{0}Space{1}", space, type);
return s_VariableNames[index];

12
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Math/Derivative/DDXNode.cs


}
static string Unity_DDX_Default(
[Slot(0, Binding.None)] Vector1 In,
[Slot(1, Binding.None)] out Vector1 Out)
[Slot(0, Binding.None)] DynamicDimensionVector In,
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
{
return
@"

}
static string Unity_DDX_Coarse(
[Slot(0, Binding.None)] Vector1 In,
[Slot(1, Binding.None)] out Vector1 Out)
[Slot(0, Binding.None)] DynamicDimensionVector In,
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
{
return
@"

}
static string Unity_DDX_Fine(
[Slot(0, Binding.None)] Vector1 In,
[Slot(1, Binding.None)] out Vector1 Out)
[Slot(0, Binding.None)] DynamicDimensionVector In,
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
{
return
@"

12
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Math/Derivative/DDXYNode.cs


}
static string Unity_DDXY_Default(
[Slot(0, Binding.None)] Vector1 In,
[Slot(1, Binding.None)] out Vector1 Out)
[Slot(0, Binding.None)] DynamicDimensionVector In,
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
{
return
@"

}
static string Unity_DDXY_Coarse(
[Slot(0, Binding.None)] Vector1 In,
[Slot(1, Binding.None)] out Vector1 Out)
[Slot(0, Binding.None)] DynamicDimensionVector In,
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
{
return
@"

}
static string Unity_DDXY_Fine(
[Slot(0, Binding.None)] Vector1 In,
[Slot(1, Binding.None)] out Vector1 Out)
[Slot(0, Binding.None)] DynamicDimensionVector In,
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
{
return
@"

12
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Math/Derivative/DDYNode.cs


}
static string Unity_DDY_Default(
[Slot(0, Binding.None)] Vector1 In,
[Slot(1, Binding.None)] out Vector1 Out)
[Slot(0, Binding.None)] DynamicDimensionVector In,
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
{
return
@"

}
static string Unity_DDY_Coarse(
[Slot(0, Binding.None)] Vector1 In,
[Slot(1, Binding.None)] out Vector1 Out)
[Slot(0, Binding.None)] DynamicDimensionVector In,
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
{
return
@"

}
static string Unity_DDY_Fine(
[Slot(0, Binding.None)] Vector1 In,
[Slot(1, Binding.None)] out Vector1 Out)
[Slot(0, Binding.None)] DynamicDimensionVector In,
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
{
return
@"

8
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Math/Vector/CrossProductNode.cs


using System.Reflection;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{

}
static string Unity_CrossProduct(
[Slot(0, Binding.None)] DynamicDimensionVector A,
[Slot(1, Binding.None)] DynamicDimensionVector B,
[Slot(2, Binding.None)] out DynamicDimensionVector Out)
[Slot(0, Binding.None)] Vector3 A,
[Slot(1, Binding.None)] Vector3 B,
[Slot(2, Binding.None)] out Vector3 Out)
Out = Vector3.zero;
return
@"
{

2
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Math/Vector/DistanceNode.cs


static string Unity_Distance(
[Slot(0, Binding.None)] DynamicDimensionVector A,
[Slot(1, Binding.None)] DynamicDimensionVector B,
[Slot(2, Binding.None)] out DynamicDimensionVector Out)
[Slot(2, Binding.None)] out Vector1 Out)
{
return
@"

7
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/Math/Vector/ReflectionNode.cs


}
static string Unity_Reflection(
[Slot(0, Binding.None)] Vector3 In,
[Slot(1, Binding.None)] Vector3 Normal,
[Slot(2, Binding.None)] out Vector3 Out)
[Slot(0, Binding.None)] DynamicDimensionVector In,
[Slot(1, Binding.None)] DynamicDimensionVector Normal,
[Slot(2, Binding.None)] out DynamicDimensionVector Out)
Out = Vector3.one;
return @"
{

正在加载...
取消
保存