浏览代码

Revert "Revert "added sphere mask node""

fixing a mistake i only just now noticed shhh
/main
Alex Lindman 7 年前
当前提交
4165fc2d
共有 3 个文件被更改,包括 53 次插入0 次删除
  1. 3
      com.unity.shadergraph/.data/sphereMask.PNG
  2. 39
      com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/SphereMaskNode.cs
  3. 11
      com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/SphereMaskNode.cs.meta

3
com.unity.shadergraph/.data/sphereMask.PNG


version https://git-lfs.github.com/spec/v1
oid sha256:8df3a610b0b2a3f8d3b6a2b9ddb563c3a74e682055b53bc728ac7f795870d9ad
size 91474

39
com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/SphereMaskNode.cs


using System.Reflection;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
[Title("Math", "Vector", "Sphere Mask")]
public class SphereMaskNode : CodeFunctionNode
{
public SphereMaskNode()
{
name = "Sphere Mask";
}
public override string documentationURL
{
get { return "https://github.com/Unity-Technologies/ShaderGraph/wiki/Sphere-Mask-Node"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("SphereMask", BindingFlags.Static | BindingFlags.NonPublic);
}
static string SphereMask(
[Slot(0, Binding.None)] DynamicDimensionVector Coords,
[Slot(1, Binding.None, 0.5f, 0.5f, 0.5f, 0.5f)] DynamicDimensionVector Center,
[Slot(2, Binding.None, 0.1f, 0.1f, 0.1f, 0.1f)] Vector1 Radius,
[Slot(3, Binding.None, 0.8f, 0.8f, 0.8f, 0.8f)] Vector1 Hardness,
[Slot(4, Binding.None)] out DynamicDimensionVector Out)
{
return
@"
{
Out = 1 - saturate((distance(Coords, Center) - Radius) / (1 - Hardness));
}
";
}
}
}

11
com.unity.shadergraph/Editor/Data/Nodes/Math/Vector/SphereMaskNode.cs.meta


fileFormatVersion: 2
guid: 6b31e904eeb9a604b9145c218287ad1e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存