浏览代码

changing input order to increase consistency. Added center input for rotate node

/main
Natalie Burke 7 年前
当前提交
e92749db
共有 3 个文件被更改,包括 16 次插入13 次删除
  1. 6
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/UV/CartesianToPolarNode.cs
  2. 4
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/UV/TwistNode.cs
  3. 19
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/UV/UVRotatorNode.cs

6
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/UV/CartesianToPolarNode.cs


static string Unity_CartesianToPolar(
[Slot(0, Binding.MeshUV0)] Vector2 UV,
[Slot(1, Binding.None, 1.0f, 1.0f, 1.0f, 1.0f)] Vector1 RadialScale,
[Slot(2, Binding.None, 1.0f, 1.0f, 1.0f, 1.0f)] Vector1 LengthScale,
[Slot(3, Binding.None, 0.5f, 0.5f, 0.5f, 0.5f)] Vector2 Center,
[Slot(1, Binding.None, 0.5f, 0.5f, 0.5f, 0.5f)] Vector2 Center,
[Slot(2, Binding.None, 1.0f, 1.0f, 1.0f, 1.0f)] Vector1 RadialScale,
[Slot(3, Binding.None, 1.0f, 1.0f, 1.0f, 1.0f)] Vector1 LengthScale,
[Slot(4, Binding.None)] out Vector2 Out)
{
Out = Vector2.zero;

4
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/UV/TwistNode.cs


static string Unity_Twist(
[Slot(0, Binding.MeshUV0)] Vector2 UV,
[Slot(1, Binding.None, 1f, 1f, 1f, 1f)] Vector1 Strength,
[Slot(2, Binding.None, 0.5f, 0.5f, 0.5f, 0.5f)] Vector2 Center,
[Slot(1, Binding.None, 0.5f, 0.5f, 0.5f, 0.5f)] Vector2 Center,
[Slot(2, Binding.None, 1f, 1f, 1f, 1f)] Vector1 Strength,
[Slot(3, Binding.None)] Vector2 Offset,
[Slot(4, Binding.None)] out Vector2 Out)
{

19
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Data/Nodes/UV/UVRotatorNode.cs


static string Unity_UVRotator_Radians(
[Slot(0, Binding.MeshUV0)] Vector2 UV,
[Slot(1, Binding.None)] Vector1 Rotation,
[Slot(2, Binding.None)] out Vector2 Out)
[Slot(1, Binding.None, 0.5f, 0.5f, 0.5f, 0.5f)] Vector2 Center,
[Slot(2, Binding.None)] Vector1 Rotation,
[Slot(3, Binding.None)] out Vector2 Out)
{
Out = Vector2.zero;

{
//rotation matrix
UV.xy -= 0.5;
UV -= Center;
{precision} s = sin(Rotation);
{precision} c = cos(Rotation);

//multiply the UVs by the rotation matrix
UV.xy = mul(UV.xy, rMatrix);
UV.xy += 0.5;
UV += Center;
Out = UV;
}";

[Slot(0, Binding.MeshUV0)] Vector2 UV,
[Slot(1, Binding.None)] Vector1 Rotation,
[Slot(2, Binding.None)] out Vector2 Out)
[Slot(1, Binding.None, 0.5f, 0.5f, 0.5f, 0.5f)] Vector2 Center,
[Slot(2, Binding.None)] Vector1 Rotation,
[Slot(3, Binding.None)] out Vector2 Out)
{
Out = Vector2.zero;

UV.xy -= 0.5;
UV -= Center;
{precision} s = sin(Rotation);
{precision} c = cos(Rotation);

//multiply the UVs by the rotation matrix
UV.xy = mul(UV.xy, rMatrix);
UV.xy += 0.5;
UV += Center;
Out = UV;
}";

正在加载...
取消
保存