浏览代码

fix error in uv rotate node.

/main
Tim Cooper 8 年前
当前提交
eb2f7590
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 8
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/UV/UVRotatorNode.cs

8
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/UV/UVRotatorNode.cs


{
//rotation matrix
uv.xy -= 0.5;
{0} s = sin(rotation);
{0} c = cos(rotation);
{precision} s = sin(rotation);
{precision} c = cos(rotation);
{0}2x2 rMatrix = float2x2(c, -s, s, c);
{precision}2x2 rMatrix = float2x2(c, -s, s, c);
rMatrix = rMatrix*2 - 1
rMatrix = rMatrix*2 - 1;
//multiply the UVs by the rotation matrix
uv.xy = mul(uv.xy, rMatrix);

正在加载...
取消
保存