浏览代码

Fixed a spherize node calculation error.

/main
bfogerty 8 年前
当前提交
874af82d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/UV/SpherizeNode.cs

2
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/UV/SpherizeNode.cs


outputString.AddShaderChunk("float2 fromUVToPoint = position - uv;", false);
outputString.AddShaderChunk("float dist = length(fromUVToPoint);", false);
outputString.AddShaderChunk("float mag = (1.0 - (dist / radiusAndStrength.x)) * radiusAndStrength.y * step(dist, radiusAndStrength.x);", false);
outputString.AddShaderChunk("float mag = ((1.0 - (dist / radiusAndStrength.x)) * radiusAndStrength.y) * step(dist, radiusAndStrength.x);", false);
outputString.AddShaderChunk("return uv + (mag * fromUVToPoint);", false);
outputString.Deindent();

正在加载...
取消
保存