initial commit
This commit is contained in:
parent
6715289efe
commit
788c3389af
37645 changed files with 2526849 additions and 80 deletions
|
@ -0,0 +1,36 @@
|
|||
using UnityEngine;
|
||||
using System.Reflection;
|
||||
|
||||
namespace UnityEditor.ShaderGraph
|
||||
{
|
||||
[Title("Math", "Wave", "Noise Sine Wave")]
|
||||
class NoiseSineWaveNode : CodeFunctionNode
|
||||
{
|
||||
public NoiseSineWaveNode()
|
||||
{
|
||||
name = "Noise Sine Wave";
|
||||
}
|
||||
|
||||
protected override MethodInfo GetFunctionToConvert()
|
||||
{
|
||||
return GetType().GetMethod("NoiseSineWave", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
}
|
||||
|
||||
static string NoiseSineWave(
|
||||
[Slot(0, Binding.None)] DynamicDimensionVector In,
|
||||
[Slot(1, Binding.None, -0.5f, 0.5f, 1, 1)] Vector2 MinMax,
|
||||
[Slot(2, Binding.None)] out DynamicDimensionVector Out)
|
||||
{
|
||||
return
|
||||
@"
|
||||
{
|
||||
$precision sinIn = sin(In);
|
||||
$precision sinInOffset = sin(In + 1.0);
|
||||
$precision randomno = frac(sin((sinIn - sinInOffset) * (12.9898 + 78.233))*43758.5453);
|
||||
$precision noise = lerp(MinMax.x, MinMax.y, randomno);
|
||||
Out = sinIn + noise;
|
||||
}
|
||||
";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ee4eb305b2f727b47bbac99de0772c18
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,31 @@
|
|||
using System.Reflection;
|
||||
|
||||
namespace UnityEditor.ShaderGraph
|
||||
{
|
||||
[Title("Math", "Wave", "Sawtooth Wave")]
|
||||
class SawtoothWaveNode : CodeFunctionNode
|
||||
{
|
||||
public SawtoothWaveNode()
|
||||
{
|
||||
name = "Sawtooth Wave";
|
||||
synonyms = new string[] { "triangle wave" };
|
||||
}
|
||||
|
||||
protected override MethodInfo GetFunctionToConvert()
|
||||
{
|
||||
return GetType().GetMethod("SawtoothWave", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
}
|
||||
|
||||
static string SawtoothWave(
|
||||
[Slot(0, Binding.None)] DynamicDimensionVector In,
|
||||
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
|
||||
{
|
||||
return
|
||||
@"
|
||||
{
|
||||
Out = 2 * (In - floor(0.5 + In));
|
||||
}
|
||||
";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ebd730c94c4864d4f84382b17d49447f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,30 @@
|
|||
using System.Reflection;
|
||||
|
||||
namespace UnityEditor.ShaderGraph
|
||||
{
|
||||
[Title("Math", "Wave", "Square Wave")]
|
||||
class SquareWaveNode : CodeFunctionNode
|
||||
{
|
||||
public SquareWaveNode()
|
||||
{
|
||||
name = "Square Wave";
|
||||
}
|
||||
|
||||
protected override MethodInfo GetFunctionToConvert()
|
||||
{
|
||||
return GetType().GetMethod("SquareWave", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
}
|
||||
|
||||
static string SquareWave(
|
||||
[Slot(0, Binding.None)] DynamicDimensionVector In,
|
||||
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
|
||||
{
|
||||
return
|
||||
@"
|
||||
{
|
||||
Out = 1.0 - 2.0 * round(frac(In));
|
||||
}
|
||||
";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0f19d607a01d3694e84c04c8eab68f9a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,31 @@
|
|||
using System.Reflection;
|
||||
|
||||
namespace UnityEditor.ShaderGraph
|
||||
{
|
||||
[Title("Math", "Wave", "Triangle Wave")]
|
||||
class TriangleWaveNode : CodeFunctionNode
|
||||
{
|
||||
public TriangleWaveNode()
|
||||
{
|
||||
name = "Triangle Wave";
|
||||
synonyms = new string[] { "sawtooth wave" };
|
||||
}
|
||||
|
||||
protected override MethodInfo GetFunctionToConvert()
|
||||
{
|
||||
return GetType().GetMethod("TriangleWave", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
}
|
||||
|
||||
static string TriangleWave(
|
||||
[Slot(0, Binding.None)] DynamicDimensionVector In,
|
||||
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
|
||||
{
|
||||
return
|
||||
@"
|
||||
{
|
||||
Out = 2.0 * abs( 2 * (In - floor(0.5 + In)) ) - 1.0;
|
||||
}
|
||||
";
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6fb595d58ba0d304cac4cf188f4e8282
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue