You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.0 KiB
39 lines
1.0 KiB
using System.Reflection;
|
|
using UnityEngine;
|
|
using UnityEngine.Rendering.HighDefinition;
|
|
|
|
namespace UnityEditor.ShaderGraph
|
|
{
|
|
[SRPFilter(typeof(HDRenderPipeline))]
|
|
[Title("Utility", "High Definition Render Pipeline", "Eye", "ScleraUVLocation")]
|
|
class ScleraUVLocation : CodeFunctionNode
|
|
{
|
|
public ScleraUVLocation()
|
|
{
|
|
name = "Sclera UV Location";
|
|
}
|
|
|
|
public override bool hasPreview
|
|
{
|
|
get { return false; }
|
|
}
|
|
|
|
protected override MethodInfo GetFunctionToConvert()
|
|
{
|
|
return GetType().GetMethod("Unity_ScleraUVLocation", BindingFlags.Static | BindingFlags.NonPublic);
|
|
}
|
|
|
|
static string Unity_ScleraUVLocation(
|
|
[Slot(0, Binding.None, 0, 0, 0, 0)] Vector3 PositionOS,
|
|
[Slot(2, Binding.None)] out Vector2 ScleraUV)
|
|
{
|
|
ScleraUV = Vector2.zero;
|
|
return
|
|
@"
|
|
{
|
|
ScleraUV = PositionOS.xy + $precision2(0.5, 0.5);
|
|
}
|
|
";
|
|
}
|
|
}
|
|
}
|