initial commit
This commit is contained in:
parent
6715289efe
commit
788c3389af
37645 changed files with 2526849 additions and 80 deletions
|
@ -0,0 +1,31 @@
|
|||
using System.Reflection;
|
||||
|
||||
namespace UnityEditor.ShaderGraph
|
||||
{
|
||||
[Title("Math", "Advanced", "Absolute")]
|
||||
class AbsoluteNode : CodeFunctionNode
|
||||
{
|
||||
public AbsoluteNode()
|
||||
{
|
||||
name = "Absolute";
|
||||
synonyms = new string[] { "positive" };
|
||||
}
|
||||
|
||||
protected override MethodInfo GetFunctionToConvert()
|
||||
{
|
||||
return GetType().GetMethod("Unity_Absolute", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
}
|
||||
|
||||
static string Unity_Absolute(
|
||||
[Slot(0, Binding.None)] DynamicDimensionVector In,
|
||||
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
|
||||
{
|
||||
return
|
||||
@"
|
||||
{
|
||||
Out = abs(In);
|
||||
}
|
||||
";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4b496ffd32c22d94bb525897d152da05
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,74 @@
|
|||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
using UnityEditor.Graphing;
|
||||
using UnityEditor.ShaderGraph.Drawing.Controls;
|
||||
|
||||
namespace UnityEditor.ShaderGraph
|
||||
{
|
||||
enum ExponentialBase
|
||||
{
|
||||
BaseE,
|
||||
Base2
|
||||
};
|
||||
|
||||
[Title("Math", "Advanced", "Exponential")]
|
||||
class ExponentialNode : CodeFunctionNode
|
||||
{
|
||||
public ExponentialNode()
|
||||
{
|
||||
name = "Exponential";
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
private ExponentialBase m_ExponentialBase = ExponentialBase.BaseE;
|
||||
|
||||
[EnumControl("Base")]
|
||||
public ExponentialBase exponentialBase
|
||||
{
|
||||
get { return m_ExponentialBase; }
|
||||
set
|
||||
{
|
||||
if (m_ExponentialBase == value)
|
||||
return;
|
||||
|
||||
m_ExponentialBase = value;
|
||||
Dirty(ModificationScope.Graph);
|
||||
}
|
||||
}
|
||||
|
||||
protected override MethodInfo GetFunctionToConvert()
|
||||
{
|
||||
switch (m_ExponentialBase)
|
||||
{
|
||||
case ExponentialBase.Base2:
|
||||
return GetType().GetMethod("Unity_Exponential2", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
default:
|
||||
return GetType().GetMethod("Unity_Exponential", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
}
|
||||
}
|
||||
|
||||
static string Unity_Exponential(
|
||||
[Slot(0, Binding.None)] DynamicDimensionVector In,
|
||||
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
|
||||
{
|
||||
return
|
||||
@"
|
||||
{
|
||||
Out = exp(In);
|
||||
}
|
||||
";
|
||||
}
|
||||
|
||||
static string Unity_Exponential2(
|
||||
[Slot(0, Binding.None)] DynamicDimensionVector In,
|
||||
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
|
||||
{
|
||||
return
|
||||
@"
|
||||
{
|
||||
Out = exp2(In);
|
||||
}
|
||||
";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2caea2ece6d6b4cbebf8bd122b11258a
|
||||
timeCreated: 1490745697
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,31 @@
|
|||
using System.Reflection;
|
||||
|
||||
namespace UnityEditor.ShaderGraph
|
||||
{
|
||||
[Title("Math", "Advanced", "Length")]
|
||||
class LengthNode : CodeFunctionNode
|
||||
{
|
||||
public LengthNode()
|
||||
{
|
||||
name = "Length";
|
||||
synonyms = new string[] { "measure" };
|
||||
}
|
||||
|
||||
protected override MethodInfo GetFunctionToConvert()
|
||||
{
|
||||
return GetType().GetMethod("Unity_Length", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
}
|
||||
|
||||
static string Unity_Length(
|
||||
[Slot(0, Binding.None)] DynamicDimensionVector In,
|
||||
[Slot(1, Binding.None)] out Vector1 Out)
|
||||
{
|
||||
return
|
||||
@"
|
||||
{
|
||||
Out = length(In);
|
||||
}
|
||||
";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 52afae1b1271e864c9c6965dc738c2dd
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,89 @@
|
|||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
using UnityEditor.Graphing;
|
||||
using UnityEditor.ShaderGraph.Drawing.Controls;
|
||||
|
||||
namespace UnityEditor.ShaderGraph
|
||||
{
|
||||
enum LogBase
|
||||
{
|
||||
BaseE,
|
||||
Base2,
|
||||
Base10
|
||||
};
|
||||
|
||||
[Title("Math", "Advanced", "Log")]
|
||||
class LogNode : CodeFunctionNode
|
||||
{
|
||||
public LogNode()
|
||||
{
|
||||
name = "Log";
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
private LogBase m_LogBase = LogBase.BaseE;
|
||||
|
||||
[EnumControl("Base")]
|
||||
public LogBase logBase
|
||||
{
|
||||
get { return m_LogBase; }
|
||||
set
|
||||
{
|
||||
if (m_LogBase == value)
|
||||
return;
|
||||
|
||||
m_LogBase = value;
|
||||
Dirty(ModificationScope.Graph);
|
||||
}
|
||||
}
|
||||
|
||||
protected override MethodInfo GetFunctionToConvert()
|
||||
{
|
||||
switch (m_LogBase)
|
||||
{
|
||||
case LogBase.Base2:
|
||||
return GetType().GetMethod("Unity_Log2", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
case LogBase.Base10:
|
||||
return GetType().GetMethod("Unity_Log10", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
default:
|
||||
return GetType().GetMethod("Unity_Log", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
}
|
||||
}
|
||||
|
||||
static string Unity_Log(
|
||||
[Slot(0, Binding.None, 1, 1, 1, 1)] DynamicDimensionVector In,
|
||||
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
|
||||
{
|
||||
return
|
||||
@"
|
||||
{
|
||||
Out = log(In);
|
||||
}
|
||||
";
|
||||
}
|
||||
|
||||
static string Unity_Log2(
|
||||
[Slot(0, Binding.None, 1, 1, 1, 1)] DynamicDimensionVector In,
|
||||
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
|
||||
{
|
||||
return
|
||||
@"
|
||||
{
|
||||
Out = log2(In);
|
||||
}
|
||||
";
|
||||
}
|
||||
|
||||
static string Unity_Log10(
|
||||
[Slot(0, Binding.None, 1, 1, 1, 1)] DynamicDimensionVector In,
|
||||
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
|
||||
{
|
||||
return
|
||||
@"
|
||||
{
|
||||
Out = log10(In);
|
||||
}
|
||||
";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a8880ad54646f8b469de662f4f0785c9
|
||||
timeCreated: 1490740341
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,32 @@
|
|||
using System.Reflection;
|
||||
|
||||
namespace UnityEditor.ShaderGraph
|
||||
{
|
||||
[Title("Math", "Advanced", "Modulo")]
|
||||
class ModuloNode : CodeFunctionNode
|
||||
{
|
||||
public ModuloNode()
|
||||
{
|
||||
name = "Modulo";
|
||||
synonyms = new string[] { "fmod" };
|
||||
}
|
||||
|
||||
protected override MethodInfo GetFunctionToConvert()
|
||||
{
|
||||
return GetType().GetMethod("Unity_Modulo", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
}
|
||||
|
||||
static string Unity_Modulo(
|
||||
[Slot(0, Binding.None, 0, 0, 0, 0)] DynamicDimensionVector A,
|
||||
[Slot(1, Binding.None, 1, 1, 1, 1)] DynamicDimensionVector B,
|
||||
[Slot(2, Binding.None)] out DynamicDimensionVector Out)
|
||||
{
|
||||
return
|
||||
@"
|
||||
{
|
||||
Out = fmod(A, B);
|
||||
}
|
||||
";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 058897be65bcd42f6ba05a4918c46629
|
||||
timeCreated: 1490745697
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,31 @@
|
|||
using System.Reflection;
|
||||
|
||||
namespace UnityEditor.ShaderGraph
|
||||
{
|
||||
[Title("Math", "Advanced", "Negate")]
|
||||
class NegateNode : CodeFunctionNode
|
||||
{
|
||||
public NegateNode()
|
||||
{
|
||||
name = "Negate";
|
||||
synonyms = new string[] { "invert", "opposite" };
|
||||
}
|
||||
|
||||
protected override MethodInfo GetFunctionToConvert()
|
||||
{
|
||||
return GetType().GetMethod("Unity_Negate", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
}
|
||||
|
||||
static string Unity_Negate(
|
||||
[Slot(0, Binding.None)] DynamicDimensionVector In,
|
||||
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
|
||||
{
|
||||
return
|
||||
@"
|
||||
{
|
||||
Out = -1 * In;
|
||||
}
|
||||
";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 27a3ba76eb1c9a54f8355034489b2e83
|
||||
timeCreated: 1495446331
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,30 @@
|
|||
using System.Reflection;
|
||||
|
||||
namespace UnityEditor.ShaderGraph
|
||||
{
|
||||
[Title("Math", "Advanced", "Normalize")]
|
||||
class NormalizeNode : CodeFunctionNode
|
||||
{
|
||||
public NormalizeNode()
|
||||
{
|
||||
name = "Normalize";
|
||||
}
|
||||
|
||||
protected override MethodInfo GetFunctionToConvert()
|
||||
{
|
||||
return GetType().GetMethod("Unity_Normalize", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
}
|
||||
|
||||
static string Unity_Normalize(
|
||||
[Slot(0, Binding.None)] DynamicDimensionVector In,
|
||||
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
|
||||
{
|
||||
return
|
||||
@"
|
||||
{
|
||||
Out = normalize(In);
|
||||
}
|
||||
";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7eb73d726827e2c41ae4d68018bc97e1
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,31 @@
|
|||
using System.Reflection;
|
||||
|
||||
namespace UnityEditor.ShaderGraph
|
||||
{
|
||||
[Title("Math", "Advanced", "Posterize")]
|
||||
class PosterizeNode : CodeFunctionNode
|
||||
{
|
||||
public PosterizeNode()
|
||||
{
|
||||
name = "Posterize";
|
||||
}
|
||||
|
||||
protected override MethodInfo GetFunctionToConvert()
|
||||
{
|
||||
return GetType().GetMethod("Unity_Posterize", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
}
|
||||
|
||||
static string Unity_Posterize(
|
||||
[Slot(0, Binding.None, 0, 0, 0, 0)] DynamicDimensionVector In,
|
||||
[Slot(1, Binding.None, 4, 4, 4, 4)] DynamicDimensionVector Steps,
|
||||
[Slot(2, Binding.None)] out DynamicDimensionVector Out)
|
||||
{
|
||||
return
|
||||
@"
|
||||
{
|
||||
Out = floor(In / (1 / Steps)) * (1 / Steps);
|
||||
}
|
||||
";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4322ad8d0cd83df47afd741a6b97d57b
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
|
@ -0,0 +1,75 @@
|
|||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
using UnityEditor.Graphing;
|
||||
using UnityEditor.ShaderGraph.Drawing.Controls;
|
||||
|
||||
namespace UnityEditor.ShaderGraph
|
||||
{
|
||||
enum ReciprocalMethod
|
||||
{
|
||||
Default,
|
||||
Fast
|
||||
};
|
||||
|
||||
[Title("Math", "Advanced", "Reciprocal")]
|
||||
class ReciprocalNode : CodeFunctionNode
|
||||
{
|
||||
public ReciprocalNode()
|
||||
{
|
||||
name = "Reciprocal";
|
||||
synonyms = new string[] { "rcp" };
|
||||
}
|
||||
|
||||
[SerializeField]
|
||||
private ReciprocalMethod m_ReciprocalMethod = ReciprocalMethod.Default;
|
||||
|
||||
[EnumControl("Method")]
|
||||
public ReciprocalMethod reciprocalMethod
|
||||
{
|
||||
get { return m_ReciprocalMethod; }
|
||||
set
|
||||
{
|
||||
if (m_ReciprocalMethod == value)
|
||||
return;
|
||||
|
||||
m_ReciprocalMethod = value;
|
||||
Dirty(ModificationScope.Graph);
|
||||
}
|
||||
}
|
||||
|
||||
protected override MethodInfo GetFunctionToConvert()
|
||||
{
|
||||
switch (m_ReciprocalMethod)
|
||||
{
|
||||
case ReciprocalMethod.Fast:
|
||||
return GetType().GetMethod("Unity_Reciprocal_Fast", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
default:
|
||||
return GetType().GetMethod("Unity_Reciprocal", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
}
|
||||
}
|
||||
|
||||
static string Unity_Reciprocal(
|
||||
[Slot(0, Binding.None, 1, 1, 1, 1)] DynamicDimensionVector In,
|
||||
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
|
||||
{
|
||||
return
|
||||
@"
|
||||
{
|
||||
Out = 1.0/In;
|
||||
}
|
||||
";
|
||||
}
|
||||
|
||||
static string Unity_Reciprocal_Fast(
|
||||
[Slot(0, Binding.None, 1, 1, 1, 1)] DynamicDimensionVector In,
|
||||
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
|
||||
{
|
||||
return
|
||||
@"
|
||||
{
|
||||
Out = rcp(In);
|
||||
}
|
||||
";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2b52706eb67bd8445b13f43ae287c679
|
||||
timeCreated: 1495445608
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,31 @@
|
|||
using System.Reflection;
|
||||
|
||||
namespace UnityEditor.ShaderGraph
|
||||
{
|
||||
[Title("Math", "Advanced", "Reciprocal Square Root")]
|
||||
class ReciprocalSquareRootNode : CodeFunctionNode
|
||||
{
|
||||
public ReciprocalSquareRootNode()
|
||||
{
|
||||
name = "Reciprocal Square Root";
|
||||
synonyms = new string[] { "rsqrt", "inversesqrt" };
|
||||
}
|
||||
|
||||
protected override MethodInfo GetFunctionToConvert()
|
||||
{
|
||||
return GetType().GetMethod("Unity_Rsqrt", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
}
|
||||
|
||||
static string Unity_Rsqrt(
|
||||
[Slot(0, Binding.None, 1, 1, 1, 1)] DynamicDimensionVector In,
|
||||
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
|
||||
{
|
||||
return
|
||||
@"
|
||||
{
|
||||
Out = rsqrt(In);
|
||||
}
|
||||
";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d67c532974f20f74ca83c79573c45a61
|
||||
timeCreated: 1495627989
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue