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.
35 lines
867 B
35 lines
867 B
using System.Reflection;
|
|
|
|
namespace UnityEditor.ShaderGraph
|
|
{
|
|
[Title("Input", "Scene", "Eye Index")]
|
|
class EyeIndexNode : CodeFunctionNode
|
|
{
|
|
public override bool hasPreview { get { return false; } }
|
|
|
|
public EyeIndexNode()
|
|
{
|
|
name = "Eye Index";
|
|
synonyms = new string[] { "stereo", "3d" };
|
|
}
|
|
|
|
protected override MethodInfo GetFunctionToConvert()
|
|
{
|
|
return GetType().GetMethod("UnityGetEyeIndex", BindingFlags.Static | BindingFlags.NonPublic);
|
|
}
|
|
|
|
static string UnityGetEyeIndex([Slot(0, Binding.None)] out Vector1 Out)
|
|
{
|
|
return
|
|
@"
|
|
{
|
|
#if defined(UNITY_SINGLE_PASS_STEREO) || defined(UNITY_STEREO_INSTANCING_ENABLED) || defined(UNITY_STEREO_MULTIVIEW_ENABLED)
|
|
Out = unity_StereoEyeIndex;
|
|
#else
|
|
Out = 0;
|
|
#endif
|
|
}
|
|
";
|
|
}
|
|
}
|
|
}
|