您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
38 行
1.0 KiB
38 行
1.0 KiB
using System.Reflection;
|
|
using UnityEngine;
|
|
|
|
namespace UnityEditor.ShaderGraph
|
|
{
|
|
/*
|
|
[Title("OLD/SpherizeOLD")]
|
|
public class SpherizeNode : CodeFunctionNode
|
|
{
|
|
public SpherizeNode()
|
|
{
|
|
name = "Spherizeold";
|
|
}
|
|
|
|
protected override MethodInfo GetFunctionToConvert()
|
|
{
|
|
return GetType().GetMethod("Unity_Spherize", BindingFlags.Static | BindingFlags.NonPublic);
|
|
}
|
|
|
|
static string Unity_Spherize(
|
|
[Slot(0, Binding.MeshUV0)] Vector2 uv,
|
|
[Slot(1, Binding.None)] Vector2 position,
|
|
[Slot(2, Binding.None)] Vector2 radiusAndStrength,
|
|
[Slot(3, Binding.None)] out Vector2 Out)
|
|
{
|
|
Out = Vector2.zero;
|
|
return
|
|
@"
|
|
{
|
|
{precision}2 fromUVToPoint = position - uv;
|
|
{precision} dist = length(fromUVToPoint);
|
|
{precision} mag = ((1.0 - (dist / radiusAndStrength.x)) * radiusAndStrength.y) * step(dist, radiusAndStrength.x);
|
|
Out = uv + (mag * fromUVToPoint);
|
|
}";
|
|
}
|
|
}
|
|
*/
|
|
}
|